INDIAN WELLS, Calif. - Milos Raonic proved he can play with the big boys on the ATP Tour, but he still has a way to go before he can beat them.

The hard-serving Canadian suffered a hard-fought 6-7 (4), 6-2, 6-4 loss to world No. 3 Roger Federer in the third round of the BNP Paribas Open on Tuesday.

Raonic started strong in the first set, winnng all his service games before beating Feferer in a tiebreaker to put pressure on the Swiss star.

But Federer showed his experience, immediately breaking Raonic to start the second set, then taking advantage of the shift in momentum to claim his 35th win in his last 37 matches since last year's U.S. Open.

"Things went well in the first set, but then he picked up his game," Raonic said. "I didn't seve as well as I wanted and he starting putting a lot of pressure on me.

"Maybe I went for too much at the start but I calmed down pretty fast. It came down to come poorly executed shots. I stil hit the ball well but I didn't hit the right shot."

The defeat leaves the 21-year-old from Thornhill, Ont., 0-3 against the big four of the ATP after losing in Tokyo in 2010 and 2011 to Rafael Nadal.

The 27th-ranked Raonic still boasts a more than respectable record 17-3 record in 2012, owning titles from Chennai and San Jose this season after two months of play.

Raonic has won 16 of 19 matches in 2012 and has beaten five top 10 players, but now stands 0-7 against top eight rivals.

"I want to learn as much as I can from this match and put myself in the position to trry and win the next one. I take a lot of positives," he said.

"I was playing against arguably the best player of all time."

Raonic started out strong in crisp night-time conditions in the desert, claiming the opening set after it went into a tiebreaker. He claimed the set on his first chance after Federer fired a forehand long.

Federer bounced straight back, starting the second set with a decisive break of Raonic, then broke him again to take a 4-1 lead. Federer took his lead out to 5-1 before levelling on a set apiece two games later on the first of two set points.

The experienced Swiss star seized the momentum in the third with a break to go up 4-3 in the final set before turning in the victory on the first of two match points as Raonic sent a forehand long.

Raonic fired ten aces but was broken three times. He also showed his inexperience, failing to challenge a couple of calls that would have gone his way.

He will move onto the next Masters 1000 event in Miami starting in just over a week.

Federer advanced to the quarter-finals where he will meet Thomaz Bellucci who advanced when Nikolay Davydenko withdrew because of illness.

It was his 73rd consecutive win against a player outside the top-20.

"I was getting to the ball often in the beginning, but just not making the plays," Federer said. "I was able to improve, and once I got that going maybe his serving also just dropped a tiny bit and gave me more opportunities on his second serves. That was a big second set for me to get momentum, particularly the first break of the second set."

Federer hasn't been feeling well since he arrived, blaming sickness among his family rather than the viral illness that has knocked eight players out of the tournament.

"Slow improvements," he said. "I'm still not 100 per cent."

Earlier, Rafael Nadal eased into the quarter-finals by beating countryman Marcel Granollers 6-1, 6-4.

It was similarly easy on the women's side for top-ranked Victoria Azarenka and No. 2 seed Maria Sharapova, who won their matches in just more than an hour.

Ana Ivanovic defeated Caroline Wozniacki 6-3, 6-2 in a matchup of former Indian Wells champions and former top-ranked players. Ivanovic served out the match with a 40-love game to complete her biggest win over a top player in months.

Nadal, ranked second in the world, has won his last 10 matches against fellow Spaniards, and 22 of his last 23 sets against them. Granollers, who has risen from 50th to 26th in the rankings over the past year, cracked a 212-km/h serve during the match, but he couldn't cover Nadal's quickness and touch.

Nadal served out the match in a deuce game, then drew cheers from female fans when removed his shirt and towelled off courtside before donning a warm-up jacket.

"I didn't play my best in the second," he said. "I had a few mistakes, especially for the backhand. But I am happy that I finished the match well."

Azarenka, a 6-3, 6-1 winner over Julia Goerges, moved on to play fifth-seeded Agnieszka Radwanska, who advanced when American wild card Jamie Hampton retired with cramping in the third set trailing 3-6, 6-4, 3-0. Azarenka (20-0) and Radwanska (20-3) have the most match wins this year on the WTA Tour.

Sharapova, who lost to Azarenka in the Australian Open final, beat Roberta Vinci 6-2, 6-1, and next plays an all-Russian quarter-final against either 20th-seeded Maria Kirilenko or No. 30 Nadia Petrova, who met later Tuesday.

"I was pretty solid and I think my pace didn't allow her to come forward as much as she would have liked," Sharapova said about Vinci.

On the men's side, fifth-seeded David Ferrer lost for just the second time this year, 6-4, 6-3 to Denis Istomin of Uzbekistan. Ferrer had already won three titles this season, and was seeking his 20th match win.

Istomin set himself up for a fourth-round match against No. 9 Juan Martin del Potro, who defeated Fernando Verdasco 6-2, 7-6 (6). Verdasco failed to convert on six break points in the match.

"Verdasco is a really difficult opponent, especially in the beginning of the big tournaments," Del Potro said. "He's very, very tough, very dangerous, and I think I made a good match. I got lucky in the second set when I save five set points, and then in the tiebreak he made the double fault to give me the first match point."

There was no immediate confirmation whether Davydenko was suffering from the same viral illness that has knocked eight players out of the two-week tournament.

Azarenka next will try to equal Serena Williams' consecutive victories streak of 21-0 to begin 2003.

"If I relax my butt a little bit, somebody's going to come and kick it," she said, laughing.

Azarenka, who has won two other titles this year, is 3-0 against Radwanska this year, with two of their matches going to three sets.

"She's someone who always comes up with something different," Azarenka said. "She's a little magician, if you can call it that."

Azarenka beat Radwanska in straight sets last month in Doha, during which Azarenka injured her ankle. She kept playing, but appeared to be in pain and was visibly distraught. Radwanska later said she "lost a lot of respect" for the 22-year-old Belarusian because her behaviour wasn't a good image for women's tennis.

"I actually never had a problem with her," Azarenka said Tuesday. "She's a great player, great girl, so nothing there is to discuss."

Hampton earned her first win against a top-20 player when she beat Jelena Jankovic in the second round and the 22-year-old from Auburn, Ala., was having her best tour-level results yet when she fell down early in the third set.

"She was really hitting the ball very well, very consistent, good serve and moving very well," Radwanska said. "I just noticed when she fell down. It's always tough, especially that you can't really have medical timeout for that. It's tough to come back."

Other winners were No. 6 Jo-Wilfried Tsonga; No. 8 Li Na; and 18th-seeded Angelique Kerber, who beat American Christina McHale in a third-set tiebreaker.