MONTREAL - To Canada's Vasek Pospisil it was a dream outing on the court: an ATP main-draw event, a big crowd and his boyhood idol Roger Federer standing on the other side of the net.

Federer beat Pospisil in their Rogers Cup matchup Wednesday in Montreal, ending a showdown between a tennis great and a 21-year-old who's idolized him since childhood.

But the 155th-ranked Pospisil didn't leave centre court without putting up a fight. The native of Vernon, B.C., kept the first set close at Uniprix Stadium before Federer finally disposed of him 7-5, 6-3.

Federer wasn't the only big name to survive a scare Wednesday, as No. 1 seed Novak Djokovic had to storm back from 4-1 deficit in the first set against Russia's Nikolay Davydenko to win 7-5, 6-1.

In his first ATP singles match since climbing to No. 1 in the rankings, the 24-year-old Serb improved his stunning 2011 record to 49-1 overall and 25-0 on hard courts.

Federer's win nudged his overall mark this year to 40-9 and his career record in Canada rose to 27-7.

The Swiss tennis star, playing his first match since turning 30 on Monday, said it's not the first time he's heard of a younger opponent's admiration.

"For me it was important to have role models to look up to, such as (Pete) Sampras and (Stefan) Edberg and so forth," he said after beating Pospisil.

"Then to be able to also play Pete at Wimbledon was very big in my career, it gave me a huge lift to be able to play in a big stadium against a big player -- and I hope it does the same for him."

Federer said he was impressed with Pospisil's performance, highlighting the Canadian's mobility and his heavy serve.

"It was a tricky match for me to play today," said Federer, who also remarked how surprised he was by Pospisil's height -- which is six-foot-three.

"He certainly showed his potential. . . He was believing in himself. This is a very important factor in tennis."

Pospisil said it felt like a dream when he walked out onto the stadium's biggest stage -- where the crowd roared around him and his boyhood hero stood at the other end of the court.

"After that I concentrated on my game and I tried to forget that I was playing against Federer," said Pospisil, who advanced Tuesday after upsetting 22nd-ranked Juan Ignacio Chela of Argentina in his first-ever ATP main-draw match.

"At first I was a little bit nervous, for sure, but after the first couple of games I actually did calm down and I felt pretty calm out there."

When a reporter told him that Federer was impressed by his level of play, Pospisil blushed, let out a nervous giggle and stumbled on his words a little bit.

"To hear that from Roger, for me it's incredible," the starstruck Pospisil said. "He's been my favourite player for eight years, so it's someone I watched on television every week, so yeah, it's nice to hear that."

Pospisil's strong service game, which scored eight aces against Federer, kept things close in the first set and the players were tied 5-5 when the veteran finally broke the Canadian.

But Pospisil also struggled at times and he volleyed a seemingly routine shot right into the net during a crucial game point that put Federer up 6-5.

Pospisil said he wanted to stick to his own gameplan and shift his focus away from the big occasion and his notable opponent.

"I thought I did pretty well to do that, maybe except for a few games that I kind of lost my concentration or made a few mistakes," he said.

"I knew (Federer) plays fast, but it's another level of fast, to be honest. I've never felt the ball go through the court as fast as his does."

Showdowns against Canadian tennis players have been a rare event for Federer, as this was just the third time he's played a Canuck opponent in 966 career matches.

And no Canadian has ever taken a set off the former world No. 1, who earned each of those victories in straight sets after downing Pospisil, Daniel Nestor at the 2000 U.S. Open and Frederic Niemeyer at the 2009 Rogers Cup. Niemeyer happens to be Pospisil's coach.

The No. 3-ranked Federer won the Rogers Cup in 2004 and 2006 and was the runner-up in 2007 and 2010, when he lost to Andy Murray.

In the next round, Federer will face No. 13 Jo-Wilfried Tsonga of France, a man who beat him in a five-set quarter-final thriller at Wimbledon.

Djokovic, meanwhile, played his first match of the tournament, which was originally scheduled for Tuesday evening before it was postponed due to rain.

He was happy to finally get back on the court after a four-week layoff, which he partly blamed for falling behind Davydenko 4-1 in the first set. He said switching surfaces from clay to grass to hard court at recent events, and playing an opponent like Davydenko, didn't help either.

"I needed some rhythm, and he didn't give me any," Djokovic said.

"I got back into the match. When I needed to use my chance, I did. Then, you know, (the) second set was much more comfortable for me."

The 2007 Rogers Cup champion also said it felt good stepping onto a court as the world's top player, particularly in front of the loud, tennis-savvy Montreal crowd.

But at the same time, he's trying to stay grounded amid all the extra attention that comes with his new status.

"Being No. 1 is a big responsibility, not just on the court but off the court as well," said Djokovic, whose last defeat came at the hands of Federer in the French Open semifinal.

"(I'm) just trying to handle it in the best possible way, but on the other side trying to keep my life very simple, the way it was before."

Heavy thunderstorms rolled in above Uniprix Stadium on Wednesday, delaying late-afternoon matchups including one between two-time Rogers Cup title-holder Rafael Nadal and Ivan Dodig.

Once the skies cleared up in the evening, some matches -- including Nadal's -- eventually got underway.

In other early singles action, No. 5 Gael Monfils of France defeated American Alex Bogomolov, 6-2, 7-6 (5); No. 7 Tomas Berdych of Czech Republic ousted Alexandr Dolgopolov of Ukraine 4-6, 6-2, 6-3; No. 8 Nicolas Almagro of Spain defeated Ukraine's Sergiy Stakhovsky 6-2, 7-6 (5); No. 10 Richard Basquet of France beat Thomaz Bellucci of Brazil, 6-1, 6-4; Tsonga blasted 15 aces to beat Bernard Tomic of Australia 6-3, 7-6; No. 14 Stanislas Wawrinka of Switzerland knocked out qualifier Michael Russell of the United States 6-3, 6-2; and Ivo Karlovic of Croatia bested Germany's Philipp Petzschner 6-7 (0), 7-6 (2), 7-6 (8).

In doubles, Andy Murray of Scotland and his brother Jamie Murray beat Canadians Erik Chvojka of Kirkland, Que., and Pierre-Ludovic Duclos of Ste-Foy, Que., 6-2, 2-6 (10-7).

Milos Raonic, Canada's top-ranked player and No. 26 in the world, is not taking part in the tournament as he recovers from hip surgery.

Notes: After expressing his reservations earlier this month, Federer says he sees positives in the Rogers Cup's new format, which has both the men's and women's tournaments underway at the same time -- one in Montreal, the other in Toronto. "I think it works well," he said. "Let's say it rains here but not there, you can still show live tennis (on TV)."