Canada looked on course for victory at Leicester City Stadium when they led 15-0 thanks to tries from former Glasgow winger DTH van der Merwe and Jeff Hassler, but Romania roared back, as two scores from Mihai Macovei reduced the gap to one before Florin Vlaicu kicked a match-winning penalty three minutes from time.
The centre held his nerve, drilling the ball home from 40 yards, prompting an explosion of yellow in the crowd and the loudest roar of the match before Romanian players poured onto the pitch at full-time to celebrate a superb win.
It means Canada have lost all four of their pool matches for the first time at the World Cup, while Romania can finish third if they beat Italy on Sunday to secure automatic qualification for 2019.
Canada: Tries: Van der Merwe, Hassler. Cons: Hirayama. Pens: McRorie.
Romania: Tries: Macovei 2. Cons: Vlaicu 2. Pens: Vlaicu.
Canada: F Jones, Hassler, Hearn, Blevins, Van der Merwe, Hirayama, McRorie, Buydens, Barkwill, Wooldridge, Beukeboom, Cudmore, Sinclair, Moonlight, Carpenter. Replacements: Pritchard for Jones (74), Trainor for Blevins (49), Mack for McRorie (49), Sears-Duru for Buydens (45), Ilnicki for Wooldridge (67), Dala for Moonlight (63). Not Used: Piffero, Gilmour.
Romania: Fercu, Lemnaru, Kinikinilau, Vlaicu, Botezatu, Wiringi, Surugiu, Lazar, Turashvili, Ion, Popirlan, Van Heerden, V Ursache, Lucaci, Macovei. Replacements: Gal for Wiringi (51), Calafeteanu for Surugiu (22), Tarus for Lazar (74), Radoi for Turashvili (65), A Ursache for Ion (45), Carpo for Lucaci (77). Not Used: Burcea, Apostol.
Referee: W Barnes (RFU)