EDINBURGH, Scotland - Wales kickstarted its Six Nations campaign with a 26-23 victory over Scotland at Murrayfield on Sunday.

Warren Gatland's team lost its opener to England but hit back in Edinburgh with tries in either half from scrum-half Rhys Webb and center Jonathan Davies for an eighth successive victory over Scotland.

Leigh Halfpenny chipped in with 16 points as Wales put a dent in growing Scottish confidence after full-back Stuart Hogg had given the hosts an early lead.

Jim Hamilton barged over in the last few seconds to draw Scotland to within three points but referee Glen Jackson called time before the home side could mount one last push to avoid a second Six Nations defeat in a row.

Halfpenny delivered an immaculate performance in attack and defense, while Scotland replied through Hogg's breakaway score and substitute lock Hamilton's late touchdown, plus three Greig Laidlaw penalties and a conversion, and a Finn Russell conversion.

The Scots again showed obvious signs of their improvement under coach Vern Cotter, yet Wales looked a more dangerous team with ball in hand and possessed outstanding runners in Webb, Davies and Halfpenny.

But Wales cannot afford another defeat, and their next two games are against France in Paris and at home to reigning Six Nations champions Ireland.

"We came up here knowing if we lost, that was the championship race over for us, so we were under a lot of pressure to deliver the win," Wales captain Sam Warburton said.

Both sides showed two changes from the opening round. Sean Lamont replaced injured Scotland wing Tommy Seymour and prop Geoff Cross took over from Euan Murray, who does not play on Sundays for religious reasons.

Wales, meanwhile, opted to rest powerful wing George North, who took two heavy blows to his head during the 21-16 defeat against England last week, so Liam Williams deputized, with Ospreys forward Aaron Jarvis replacing concussed tighthead prop Samson Lee.

Halfpenny opened the visitors' account with a short-range penalty after six minutes. Wales, though, pressed the self-destruct button just three minutes later when Scotland lock Richie Gray stole turnover possession 10 meters inside his own half, and Hogg outsprinted a shell-shocked Welsh blindside defense to claim an opportunist try that Laidlaw converted.

Scotland should have punished Wales again shortly afterward when Russell broke with menace, but center Alex Dunbar's pass failed to find his midfield partner Mark Bennett and a glorious chance went astray.

Laidlaw's penalty then put Scotland 10-3 ahead, but that strike was quickly cancelled out by Halfpenny's second successful kick as Wales cut its arrears at the end of a breathless opening quarter.

Wales gained a numerical advantage nine minutes before halftime when Russell received a yellow card after a mid-air challenge on his opposite number Dan Biggar.

And Scotland was punished almost immediately as Wales launched a flowing attack highlighted by Davies' surging run, before Webb collected Williams' inside pass and posted his second try in successive Six Nations games this season.

Halfpenny landed the touchline conversion attempt, taking Wales into a 16-10 halftime lead.

Scotland immediately cut the gap after Russell returned through another Laidlaw penalty when Wales center Jamie Roberts was punished for not releasing, but a more ominous-looking sign for Wales was a scrum that creaked with worrying regularity.

Halfpenny's fourth successful penalty then made it 19-13 to Wales, before a Laidlaw strike cut the gap, but Wales should have moved clear when it broke Scotland's defense midway through the second period.

Williams dived gleefully to score in the corner, yet referee Glenn Jackson consulted the television match official and then rightly ruled out the try following obstruction by two Wales forwards during the immediate build-up.

But Wales effectively made the game safe 16 minutes from time when Davies crashed through a couple of weak tackles, touching down between the posts for a try that Halfpenny converted.

Hamilton touched down with the game's final attacking phase, with Russell converting, but Wales prevailed and collected two vital points.

"We got close and showed some good signs and played some good rugby, but we have to improve on our high-ball reception," Cotter said.