Understrength Connacht pulled off a terrific result as tries from Brian Tuohy and John Muldoon, allied to a 100% kicking return from Miah Nikora, steered the province past Samoa at the Sportsground.
Samoa ended the first quarter with a 10-3 buffer, courtesy of an early Lolo Lui penalty and Misioka Timoteo's converted try.
Miah Nikora added his second and third penalties to close the gap and the sides swapped tries as the first half ended with the tourists only marginally ahead – 17-16.
Falemiga Selesele caught the Connacht defence napping when scoring Samoa's second try, five minutes before the break. But the hosts hit back immediately, with Troy Nathan's flicked pass sending Brian Tuohy over to the left of the posts.
Sin-binnings for scrum half Junior Poluleuligaga and hooker Ti'i Paulo, in the third quarter, dented Samoa's efforts, and Connacht took advantage as they moved 26-22 ahead in the 62nd minute.
An initial Nikora penalty was followed in the 56th minute try by a well-taken try from Samoan replacement Brando Va'aulu.
But Lui, who missed a penalty just minutes earlier, failed to add the conversion. And with Connacht coming to the fore in the final quarter, particularly up front, the match-winning try fittingly fell to their regular captain John Muldoon, who was released by the Irish management for the game.
Samoa travelled to Galway with a strong matchday squad which included former Connacht centre Gavin Williams.
Lolo Lui, who led Samoa to their first ever IRB Sevens World Series title last season, captained the tourists from half-back, alongside vice-captain and recent Exeter Chiefs recruit Poluleuligaga.
IRB Sevens Player of the Year Mikaele Pesamino, who has signed for Sale Sharks, and the New Zealand-based Sinoti Sinoti and Jamie Helleur offered a threat in the backs, while they had Clermont Auvergne hooker Paulo and Wasps lock/flanker Daniel Leo in their starting pack.
Connacht coach Eric Elwood gave a number of young players a chance to impress. Winger Shane Monahan, South African prop Dylan Rogers and back rowers Eoin McKeon and Shane Conneely both made their competitive debuts for the province.
Notably, the 22-man panel included eight players who have graduated from the Nigel Carolan-led Connacht Academy in recent seasons. One of them, promising centre Eoin Griffin, went on to win the man-of-the-match award.
Experienced hooker Adrian Flavin captained the home side at hooker, while much was expected of half-backs Nikora and Cillian Willis.
In crisp, windless conditions, Samoa started brightly. Their forwards showed good ball retention, before number 8 Ezra Taylor helped force a relieving penalty for the westerners. Flavin led the charge as Connacht made it into the visitors' 22, only for referee John Lacey to penalise Barry Fa'amausili for holding on after the tackle.
The Samoans used quick turnover ball to threaten the Connacht try-line, with Leo heavily involved, and although a solid tackle from Tuohy halted their surge, Lui mopped up by landing the opening points from in front of the posts.
Connacht quickly got back on the attack, building through the phases before Troy Nathan sent a grubber kick through for Tuohy and Griffin to chase. Samoa won their own lineout, however, and cleared the danger.
In the 12th minute, Nathan darted through a gap on the right, but his one-handed pass was knocked on by supporting winger Monahan five metres out from the try-line.
Four minutes later, McKeon and Mike McComish initiated a half-break again on the right before play was swept out to the left when Griffin took a bouncing ball and was held up.
Willis tried to scramble his way over, tackled by Leo, before Samoa hooker Paulo was penalised for coming in at the side of a ruck and Nikora opened Connacht's account from the resultant kick.
An offside decision against Flavin allowed Lui kick Samoa towards the right corner and took points away from their visit to the 22, thanks to Timoteo's try. A diagonal run from Poluleuligaga split the home defence, his deft pass invited Timoteo through and the flanker handed off Ronan Loughney on his way to the line.
Nikora slotted a 23rd minute penalty after his own midfield break and some good continuity from the backs and forwards.
But Samoa were posing plenty of problems for the Connacht defence. Lui charged down Nikora's attempted clearance and thought he had scored in the right corner – only for television match official Dermot Moloney to rule it out.
Pesamino put boot to ball and hacked it on again as he broke through the middle. The alert Tuohy had to be quick off the mark to track back and touch down for a 22-metre drop out.
Strong running from Monahan who broke a couple of tackles and an angled burst from Loughney helped set up a third penalty for Nikora who was able to close the gap to 10-9, eight minutes before the break.
That good work was undone in the 35th minute, Selesele dashing away off the back of a ruck to go over unchallenged and Lui converting comfortably.
But Connacht wasted little time in replying. They put the exciting Griffin into space on the left, he offloaded to Nathan whose well-timed pass back inside sent Tuohy over for a well-executed team try. Nikora's conversion put a single point between the sides again, setting up a well-contested second half.
Connacht took the lead in the 44th minute after Poluleuligaga was yellow carded for a professional foul and Nikora left-footed his fifth successful place-kick of the night.
Although Lui missed a chance to reply, after Taylor was penalised in the 53rd minute, Samoa soon crafted a superb second try.
Winger Fautua Otto broke from deep and with the Connacht defence stretched, a long pass from centre Helleur was gathered by Va'aulu who slid over in the left corner to complete a free-flowing attack. Lui could not add the extras.
Connacht failed to take advantage of Samoa's first sin-binning, but crucially they were much more clinical after Paulo saw yellow in the 58th minute for a high tackle on Willis.
Replacement Darragh Fanning used his strength to power through a couple of tackles and good driving from the Connacht forwards drew loud approval from the decent crowd present.
With Samoa now defending close to their line, scrum half Conor O'Loughlin passed to the left from a close range ruck for fellow replacement Muldoon to dive over past Na'ama Leleimalefaga for what out to be the match-winning try.
Nikora maintained his 100% record with a sweetly-struck conversion, nudging Elwood's men into a four-point lead that they never looked like giving up.
They almost added a third try while Paulo was still off the pitch. The very effective O'Loughlin collected his own kick near the left touchline and charged into the visitors' 22. Having been caught close to the Samoan whitewash, he managed to offload for Muldoon to make it over the line, but the pass was ruled forward by referee Lacey.
O'Loughlin then produced a great steal as he hassled number 8 Richard Muagututia at the back of a scrum just inside the Samoan half. His forwards joined him in mauling through and securing possession and a series of drives followed.
Young replacement Conneely announced himself with a well-timed tackle on Williams which forced a 76th minute scrum. Thereafter, Connacht had a relatively untroubled finish, the Samoan threat petering out after the impressive Tuohy hauled down Otto on a late counter attack.
Referee: John Lacey (IRFU)