"I'm extremely happy, it's a tough match. David's been on a great run, winning in Paris was so deserving," Federer told BBC Sport. "It was a long match and I'm extremely happy. I played a great match.
"You say I've qualified and I'm obviously relieved and thrilled that that's the case. Ferrer is so respected by the fellow competitors.
"I enjoy playing against him, not because of the 14-0 [head-to-head record] but because he's a great guy and a great competitor."
Federer plays his final group match against Juan Martin del Potro on Saturday.