"Mirka and I are so incredibly happy to share that Leo and Lenny were born this evening," the world number four said in a statement.
The twin boys come four years after Mirka Vavrinic gave birth to twin girls.
Federer withdrew earlier Tuesday from the Madrid Masters, giving no hint of how close the birth was.
"I've decided to withdraw from Madrid to be with my wife Mirka during these next few exciting weeks for our family," the 17-time grand slam winner had said on his Facebook page.
The French Open starts in less than three weeks, with hopes that Federer will be in the field.
Federer's sister, Diana, is the mother of twins, too.