EDMONTON — It went the limit, but Canada is still in it.

Denis Shapovalov narrowly defeated Yuki Bhambri 3-2 as Canada evened up its best-of-five Davis Cup tie against India at 1-1 on Friday night.

The Canadian teenager needed three hours 52 minutes to take the match, 7-6, 6-4, 6-7, 4-6, 6-1.

"It's my first five-set match, for sure the longest I have been on the court," Shapovalov said.

"It was a lot of tennis and a lot of ups and downs. I was able to regroup and start a new fresh page in the fifth and was able to play at a really high level at the end."

Winning the first set 7-6 (2) in a tiebreaker, Shapovalov then turned on the jets and won the next set 6-4, before falling 7-6 (6) in the third and then 6-4 in the fourth.

He would bounce back in a big way during the pressure of the fifth set, however, emerging with a huge 6-1 victory. Shapovalov had 20 aces in the match, compared to only two for Bhambri.

Shapovalov is currently ranked 51st in the world, while Bhambri is 157th.

The 18-year-old Canadian phenom has been on quite the run this season, going 18-3 since Wimbledon, including wins over the likes of Rafael Nadal at the Rogers Cup and Jo-Wilfried Tsonga at the recent U.S. Open.

"It's been a crazy last two months," he said. "I have had a lot of success and playing some great tennis. I have a lot of confidence right now and it helps me to win tough matches like today. I believed in myself and stayed tough."

It was a bit of vindication for Shapovalov, who in some ways caused the necessity of the tie with India when he slapped a loose ball in frustration and broke an orbital bone of chair umpire Arnaud Gabas during the deciding match of the series against Great Britain in February in Ottawa, getting banished as Canada lost 3-2.

In the early singles match, Brayden Schnur lost 3-1 to Ramkumar Ramanathan.

Schnur won the first set before dropping the next three. Ramanathan took the match 5-7, 7-6 (4), 7-5, 7-5.

The Canadian was making his first Davis Cup appearance on the indoor hard court at Northlands Coliseum, subbing in for the first singles match with Vasek Pospisil nursing a back injury.

"I thought I did a good job of not panicking, but there are moments where I wish I had given a little bit more energy to get the crowd behind me," Schnur said. "It's something I will learn from, when to give energy in these long matches. My legs got a little heavy by that fourth set.

The 22-year-old Toronto native is currently ranked 202 in the world, while Ramanathan, also 22, is 154th.

Canada entered the event in 16th place in the nations rankings, followed closely by India in 18th.

The Davis Cup tie will continue on Saturday in Edmonton with a doubles match featuring Canada's Daniel Nestor (world No. 43) and Pospisil (111th) facing India's Rohan Bopanna (19th) and Purav Raja (56th).

Singles play wraps up the tie on Sunday with Shapovalov and Schnur facing each other's previous opponents from Friday's matches.

"We have a great team and I think we are going to pull this tie out," said Schnur.

The winning nation will be competing in the World Group for 2018, with the losing country to be relegated to its respective zonal group.