The 20-times Grand Slam champion later played some rooftop tennis with the girls before inviting them for lunch.
"I nearly fainted when he showed up," Vittoria was quoted as saying by The Times.
"He figured out the distances pretty fast and started playing shots between his legs from one roof to another, which was amazing.
"I didn't think he was real. I thought it was a mannequin."
Federer also told the girls he had arranged for them to go to a summer camp at the Rafa Nadal Academy.
"Personally, for me, that was a very special moment in my career as a tennis player to surprise a fan, or children, like I was able to with Carola and Vittoria today,” Federer said.
"I have played in many cool places around the world, but this one is definitely up there for me as a special experience. We showed that we can play anywhere and have fun with it."