Roger Federer, who beat 18-year-old Taylor Fritz in the first round in Stuttgart, said that he was up and down in his first match since withdrawing from the French Open.

But the Swiss was satisfied overall with his 6-4, 5-7, 6-4 victory.

The 34-year-old Federer admitted he is rusty, but he’s pleased with his performance given his recent injury problems.

“I got the feel of playing matches again," Federer said. “It was also good to see how the body reacted. The match was short but I felt good. No tension. My energy level was up and down. It's a good thing I found it again at the end. I was wondering where it went during some of the match. It just felt good to be back on the match court.”

The match was played over two days because of rain.

Federer has had an injury-interrupted season. The 17-time Grand Slam champion reached the final in Brisbane and the semifinals of the Australian Open, but then had knee surgery and was unable to play for two months.

He returned in Monte Carlo, but lost to Jo-Wilfried Tsonga in the quarters and withdrew from Madrid with a back injury. He did manage to play Rome, but went down early against Alexander Zverev before deciding not to play the French Open.

His teenage opponent, Fritz, said he managed to push Federer.

“If I'd known I would take a set off Federer, I would have been pretty happy,” said the 65th-ranked American. “I have great respect for Federer, but I also showed I was not afraid to test him by winning the second set and trying to win the match. I hung in there.”

While Federer is aging, the world No. 3 is still playing extremely well on grass. In the past three years, he’s won back-to-back titles in Halle and twice been a finalist at Wimbledon. Federer’s last major championship came in 2012, when he beat Andy Murray in the Wimbledon final.

On Friday, in the Mercedes Cup quarterfinals, Federer edged Florian Mayer, 7-6 (2), 7-6 (1).

He’ll play world No. 7 Dominic Thiem in the semis.