Motherwell 3-1 Kilmarnock: Well secure Premiership safety
McHugh, Ainsworth and Frear netted while Frizzell added one for the visitors.
Second-half goals from Lionel Ainsworth and Elliot Frear secured Motherwell's top-flight status for a 33rd consecutive season after a 3-1 victory over Kilmarnock.
Ainsworth netted with a brilliant free-kick from a tight angle before Frear scored on the breakaway to move Motherwell six points ahead of second-bottom Hamilton, who lost 3-2 against Ross County.
Carl McHugh had given Motherwell a lead inside a minute but Kilmarnock, playing with the freedom of a team who had already secured their Premiership safety, came back well and levelled through Adam Frizzell.
Hamilton were already a goal down in Dingwall by the time Motherwell kicked off and the mood around Fir Park was further lifted when Frear won a corner seconds later. The home players congregated beyond the back post but McHugh broke off towards the front past and met Frear's low delivery, sweeping it into the bottom corner.
Killie quickly settled though and Jordan Jones began to cause all sorts of problems down the left, first starting the move which ended with the unmarked Dean Hawkshaw shooting well over from 20 yards.
The visitors levelled in the 17th minute following another move from the same side. David Ferguson took the sting out of Jones' cross but Keith Lasley mis-controlled and Frizzell placed a shot inside the far post.
Chris Cadden volleyed just wide after Louis Moult's knockdown at the other end but Jones soon set up Greg Taylor with a defence-splitting pass. Russell Griffiths came well off his line to block and then set up Moult with his kick-out but Jamie MacDonald also saved one-on-one.
Ferguson was booked for a foul on Jones and was skinned by the former Middlesbrough player moments later, with Griffiths saving at his near post after the winger beat another man.
Stephen Robinson had seen enough and replaced Ferguson with Lionel Ainsworth in the 38th minute, with Cadden moving to right-back, but Killie again came close in the final minute of the half when Taylor curled a shot on to the top of the bar from 20 yards.
Taylor was at the heart of the action as Motherwell regained the lead within eight minutes of the restart. The full-back was booked for what looked a fair tackle on Frear just outside the edge of the box. As everyone waited for a cross from the free-kick, Ainsworth powered a swerving drive into the far corner past a stunned MacDonald.
MacDonald soon got a fingertip to Cadden's low cross to deny Moult a tap-in and Kilmarnock again recovered well from conceding as they began to dominate possession and push Motherwell back, and Frizzell shot just over from 20 yards.
The tension eased as the home fans celebrated Ross County taking the lead and Scott McDonald was inches away from converting Frear's ball across goal, but Hamilton were equalising at the same time in Dingwall.
But there was breathing space for the hosts in the 78th minute when Ainsworth won the ball and fed Moult, whose ball inside found Frear in yards of space. The winger rounded MacDonald and netted his first goal for the club.
The celebrations ramped up a gear in the closing stages when County took the lead and continued after the final whistle.