Bern, Switzerland , 6 July 2011 | AP

Roger Federer believes Wimbledon champion Novak Djokovic’s rise to become the top-ranked player in the world is good for tennis.

Federer, the only player to have beaten Djokovic this year, said his rival has earned his success.

“He deserves to become No. 1 after an immense start to the year,” said third-ranked Federer, who defeated the 24-year-old in the French Open semi-finals.

“When you lose so rarely, your confidence carries you a long way.”

The 29-year-old said it wasn’t a big surprise Djokovic dethroned Rafael Nadal after having beaten the former top-ranked Spaniard in four previous finals in 2011.

“And he’s proved before at Wimbledon that he can play on grass,” Federer said ahead of Friday’s start to Switzerland’s Davis Cup tie against Portugal.

“It’s good for tennis that it happened.”

The six-time Wimbledon champion would have met Djokovic in the semi-finals at the All England Club but he lost in the quarter-finals to Jo-Wilfried Tsonga of France.

The five-set defeat was the first time Federer wasted a two-set lead in a Grand Slam singles match, and just the third such reverse in his career.

The first came against former No. 1 Lleyton Hewitt in the 2003 Davis Cup semi-finals against Australia – the closest Federer has come to lifting the trophy.

Since then, Federer has won all 12 singles matches on national duty, the most recent against Italy in September 2009 to help keep Switzerland in the elite 16-nation world group.

The Swiss were relegated after losing last year to Spain and then Kazakhstan, when national hero Federer received rare criticism for skipping the tie.

“If I’m playing, it’s a priority,” Federer said. “Our priority is to get back into the world group.”

Switzerland must beat Portugal over five matches on indoor hard courts in Bern to earn a playoff tie in September.