A stoppage-time try by replacement Josh Macleod saw 14-man Scarlets edge Ospreys 12-9 in a dramatic Guinness PRO14 derby at a rain-drenched Parc y Scarlets.
The victory - secured despite the first-half dismissal of wing Steff Evans following a dangerous challenge on opposite wing Ben John - took the hosts back to the top of Conference B.
Sam Davies had kicked Ospreys into a 9-5 lead going into the final minutes, but Macleod collected Scott Williams' cross-kick to go over in the left corner to settle the west Wales derby in Scarlets' favour.
Scarlets spent the majority of the first quarter in Ospreys' territory, but Halfpenny missed penalties on four and seven minutes.
Ospreys were forced into a change on 11 minutes when Dan Evans limped off to be replaced at full-back by Dan Biggar.
Halfpenny missed his third penalty on 14 minutes but, in the teeming rain, Ashley Beck knocked on from the resulting five-metre scrum, which saw Steff Evans step and go over down the blindside. Halfpenny was wayward with the extra points.
Scarlets had the chance of a second try six minutes later when Gareth Davies hacked upfield after charging down a Davies kick. Jonny McNicholl picked up close to the line but Hadleigh Parkes could not gather the pass.
The sending-off controversy came three minutes from half-time when Steff Evans clattered into John as he attempted to collect a Sam Davies cross-kick. Referee Ian Davies showed Evans red after reviewing the footage, with John forced to go off for a head injury assessment.
Davies kicked the resulting penalty two minutes from the break to get Ospreys on the board. The hosts led 5-3, their dominance not reflected on the scoreboard due to Halfpenny's uncharacteristic wayward kicking in the testing conditions.
The second half was further dictated by the wind and rain, and, down to 14 men, Scarlets struggled to get going. They conceded penalties on 51 and 62 minutes, both kicked by Davies.
The game looked Ospreys' until the clock went red and a strong Scarlets scrum gave them a foothold in the opposition 22. The winning try arrived on 82 minutes with a cross-kick from Williams put Macleod over in the left corner. Halfpenny converted as the home crowd celebrated wildly.