VANCOUVER -- Chalk two up for the underdogs.

Milos Raonic and Frank Dancevic staked Canada to a 2-0 lead over favoured Spain on the first day of a Davis Cup tie on Friday.

After Raonic opened with a hard-fought win over Albert Ramos, Dancevic cruised to a straight-sets victory over Marcel Granollers, putting their squad on the verge of a major upset -- and Canadian tennis history -- in the best-of-five series.

Spain, ranked No. 1 in the world, is a five-time Davis Cup champion and reached the finals last year before being upset by the Czech Republic. Canada, meanwhile, has never advanced beyond the first round of World Group play, which is open to the top 16 countries.

With a win in doubles play Saturday, Canada can advance further than it ever has in Davis Cup play.

Dancevic, a 28-year-old Niagara Falls, Ont., native, defeated Granollers, Spain's top singles player for this event, 6-2, 6-2, 6-2 with relative ease.

In the opening match, Raonic struggled early, but still got Canada off to a good start. The Thornhill, Ont., native overcame a one-set deficit to beat Albert Ramos 6-7, 6-4, 6-4, 6-4 at UBC's Thunderbird Sports Centre.

"I don't think I faced a break point, so I took care of my serve," said Raonic. "I was a little bit disappointed a few times. I was 40-love and I would make sloppy mistakes to 40-15 and let him get to 40-30.

"I just need to execute those a little bit better."

Raonic's Spanish opponent allowed that he was outplayed.

"I played well, but in the end he played better than I did," said Ramos.

Raonic, ranked 15th in the world, entered the match as the clear favourite. Ramos, ranked 51st, and listed as Spain's No. 2 singles player for this event, was playing his first-ever Davis Cup match.

But Ramos was not consoled by his strong early showing or the way he battled throughout the contest.

"I'm not happy," he said. "I play to win, so I'm not happy."

Raonic struggled early, hitting the net several times on what appeared to be routine forehand shots. Raonic held a 5-3 lead in the first-set tiebreaker, but missed while attempting to return a long Ramos shot to go down 6-5 and then hit a shot long to give the Spaniard the opening set.

"It was a little frustrating (to lose the first set), because until we changed sides (during the tiebreaker) after the sixth point, I had three chances on the forehand -- and three times I hit the net," said Raonic. "So it was frustrating because I had the chances.

"And then I got ahead, and after that I think he played well. But because I knew I was creating those chances I was feeling OK (about the loss of the first set.)"

Raonic said he adjusted in the second set to ensure that Ramos could not keep his shots along the sideline in.

"He was hitting the spots, that was the one thing, especially in that first set," said Raonic. "He was getting awfully close to the line. Then I sort of adjusted, and I was standing a lot more over to the left. I was just lowering the margin for him ... And in the second and third sets, I had a lot of second-serve return opportunities."

Raonic battled his way through the third set to go up 2-1, but found himself trailing 3-2 in games in the fourth set before forging a 3-3 tie. But Ramos took a 4-3 lead, forcing Raonic to battle his way back yet again.

Raonic took the next game on a service winner and then broke Ramos for the third time to go up 5-4. The final game was close again, but holding a precarious 40-30 lead, Raonic took the match with an ace.

He finished with 26 aces on the day, while Ramos recorded 13. However, the Spaniard never managed to break Raonic's serve over the course of 43 games.

"It was difficult to return the Canadian's serve," said Ramos.

Spain is playing without four of its highest-ranked players -- David Ferrer (fourth), Rafael Nadal (fifth), Nicolas Almagro (11th) and Fernando Verdasco (24th) -- this weekend.

While Nadal and Almagro are recovering from injuries, Ferrer and Verdasco chose to rest.

Raonic said the first win was "very important" for Canada's confidence. He triumphed while playing the opening match in Davis Cup play for the first time.

"The only thing I have to get used (to) today that's a little bit different than playing the second match, like I've always done before, is that opening ceremony," he said. "People expect you to be calm, quiet, but I sort of like to get activated before.

"So during that whole opening ceremony, I was like fidgeting back and forth and then during the national anthem, out of respect, you stand still.

"But that (ceremony) the only difficult thing (about preparing for the opening match) because your routine changes a bit going out there. But I think it's important. It's a psychological thing to start off well, but also at the same time I think it gets the crowd on the right track."

As it turned out, Raonic did not get the start he wanted, but he got the finish he wanted and Canada needed, much to the delight of the raucous red-and-white clad, flag-waving crowd.

"I was not giving them too much to work with, but it was amazing how supportive they were and how loud they were," he said.