Canada booked its ticket to the Rugby World Cup on Friday with a 27-10 win over Hong Kong, completing a perfect run at a last-chance qualifying tournament.

The Canadian men had to rely on their defence in the first half, repeatedly repelling a Hong Kong team that had 75 per cent of the possession but trailed 14-3 at the break. Canada (3-0-0) bent but didn't break with Hong Kong (1-2-0) unable to take advantage of its chances.

Canada was in control in the second half, grinding out the win.

Canada, ranked 21st in the world to No. 22 for Hong Kong, becomes the 20th and last team to make the field for the 2019 World Cup in Japan, Sept. 20-Nov. 2. The road doesn't get any easier for Canada, which will slot into Pool B at the World Cup alongside top-ranked New Zealand, No. 5 South Africa, No. 14 Italy and No. 23 Namibia.

Canada defeated No. 30 Kenya (65-19) and No. 28 Germany (29-10) earlier at the four-team repechage tournament.

DTH van der Merwe shines as Canada qualifies for Rugby World Cup:

van der Merwe scored two tries as Canada beat Hong Kong 27-10 to qualify for the Rugby World Cup 2019 in Japan. 1:06

'Super-scrappy game'

"A super-scrappy game but we're just so happy to get away with the win," said Canada captain Phil Mack.

"Now the hard work really starts and we've got to go to the World Cup and perform," he added.

Friday's victory improved Canada's record to 11-20-1 since the last World Cup in 2015.

The Canadians have never missed out on the sport's showcase event. But it was a lot more difficult getting there this time.

In past years, Canada qualified at the first attempt. This time it had to qualify via the last-ditch repechage after losing series against the 13th-ranked United States and No. 18 Uruguay.

Friday's game opened in the rain at Stade Delort. While the downpour slowed, it made for slick conditions on a field that looked the worse for wear from the repechage.

Winger DTH van der Merwe scored two tries and veteran hooker Ray Barkwill added another for Canada. Gord McRorie kicked three conversions and two penalties. Van der Merwe, Canada's all-time try scoring leader, had five tries to lead all-comers at the repechage.

Conor Hartley scored a try for Hong Kong. Matt Rosslee kicked a penalty and a conversion.

Millions of dollars in funding and, to some degree, Canada's rugby reputation, were at stake in Marseille.

Funding badly needed

Rugby Canada badly needs the funding that World Rugby provides to World Cup participants. And the Canadian men have struggled to hold their own in recent years. Missing out on the World Cup would have been a body blow.

After scoring a pair of bonus-point wins, the Canadians came into Friday's game in the driver's seat with 10 points. Hong Kong, which lost 26-9 to Germany and picked up a bonus point in beating Kenya 42-17, had five points.

Hong Kong needed to beat Canada and score four tries for a bonus-point win while denying the Canadians a bonus point in losing (by seven or less points). That would have left both teams on 10 points, with Hong Kong winning the tiebreaker by virtue of beating Canada.

Hong Kong dominated the early going, laying siege on the Canadian goal-line for the first 12 minutes. Needing tries in its hunt for a bonus point, Hong Kong opted for scrums rather than kicks at goal when awarded penalties.

The Dragons made an early statement, winning a scrum penalty by shoving the Canadians backwards after an infraction at the kickoff. The news was not so good for Hong Kong when centre Tyler Spitz limped off in the third minute with a leg injury.

After a lineout in the Canadian end, Hong Kong mounted a 17-phase attack that resulted in a offside penalty against lock Evan Olmstead. Hong Kong opted for a scrum, launching a 14-phase attack finally cut short by another Canadian penalty.

A third penalty near the Canadian goal-line drew another scrum but this time Canada won the set-piece battle and a penalty to get some relief.

After absorbing the pressure, Canada struck at the other end with the 38-year-old Barkwill crashing over from close range in the 18th minute to cap an attack started by a fine run from fullback Theo Sauder.

Friendship put aside

A 24th-minute try by Hong Kong scrum half Liam Slatem was wiped out on video review for a knock-on by Hartley.

Hong Kong got on the board with a 33rd-minute Rosslee penalty. Roslee was forced to go for goal when a team official came on the field with water after the penalty was awarded, taking away Hong Kong's other options.

Things went from bad to worse when van der Merwe scored off the ensuing kickoff, blocking a Rosslee kick and then retrieving the ball and rolling over the goal-line for a try,

French referee Romain Poite warned Canada about the number of infractions, sending McRorie to the sin bin in the 39th minute for an intentional knock-on. Hong Kong attacked the Canadian goal-line, only to give up a penalty for not releasing the ball.

Hartley, a supersized winger, crashed over in the 52nd minute for a converted try that cut the lead to 14-10. McRorie missed a penalty attempt in the 58th minute but slotted over kicks in the 62nd and 67th minutes.

Van der Merwe, headed to his fourth World Cup, then beat four would-be tacklers down the left flank for a try in the 71st minute.

Prop Hubert Buydens, a veteran of the 2011 and 2015 World Cups, earned his 50th cap.

Friendship was put aside Friday. Canada coach Kingsley Jones used to play under Hong Kong coach Leigh Jones, a fellow Welshman, and counts him as a close friend. So is David (Dai) Rees, chief rugby operations officer of the Hong Kong Rugby Union.

Hong Kong overcame Malaysia and South Korea in the Asia Rugby Championship before defeating the Cook Islands (77-3 on aggregate) in an Asia-Oceania playoff to advance to the repechage.