So much for the end of the world and the predictions of meteors, gamma-ray bursts and solar storms.

That's just your average Friday night in Paisley.

Armageddon may not have arrived yesterday but, in this barn-storming contest, St Mirren produced something of an earth-shattering event themselves last night. Against a high-flying Motherwell side boasting one of the best away records in the Clydesdale Bank Premier League, the struggling hosts – with just one win from their previous 10 league matches – turned their form around during an encounter that the visitors had threatened to turn on its head in the last knockings.

A Steven Thompson double late in the first half had St Mirren in complete control but they had to fight to the bitter end to safeguard the three points after a Bob McHugh goal with 13 minutes remaining sparked a fraught finish.

"I was delighted with the overall performance," said Danny Lennon, the St Mirren manager. "We had a really good 60 minutes in terms of owning the ball but in that last 20 minutes we came under severe pressure. That's where we demonstrated a great resilience and a strong mentality that shows we won't be broken."

After a cagey display at Celtic Park last weekend, St Mirren were like a runaway juggernaut last night during a fast and furious opening spell in which the ball was battered hither and thither. Yet while there was no shortage of zeal on show, there was a distinct lack of composure and direction.

This general scrappiness led to the first chance for the home side when Shaun Hutchison's reckless pass out of defence was pounced on by Jon Robertson but, with team-mates making darting runs to the left and right of him, he opted for a raking drive that sailed into the stand. Lewis Guy was then set bounding clear down the flank but, with the on-rushing Thompson roaring for the ball to be knocked across into his path, he plootered too long and the opportunity petered out.

Motherwell were struggling to gain a foothold in the match and St Mirren's menacing advances almost reaped reward in the 18th minute. The value of having a player acting as a sentry on the post at a corner was illustrated when John McGinn's cross was jabbed goalwards by Jim Goodwin and Keith Lasley hoofed the ball off the line.

The Saints were marching on all right, but it was Motherwell who broke out and came within a whisker of forging a lead on 22 minutes when Hutchison's towering header was tipped on to a post by Craig Samson. It may have been a dour old night but the honest, hearty fare being served up helped to warm the senses.

Thompson had a goalbound effort thwarted by Simon Ramsden just after the half hour but the experienced striker would not be denied in the 39th minute as he plundered the opener. Marc McAusland battled manfully for possession on the touchline before sending Robertson charging clear into the box, with his cut-back neatly cushioned into the net by Thompson's right boot.

Motherwell were reeling and St Mirren dished out another meaty blow as half-time loomed. The visitors, looking to mount a counter attack, surrendered possession in the middle of the park and swiftly found themselves on the back foot. Gary Teale surged forward and his deep cross to the back post was headed home by Thompson. The hosts were in raptures and their beleaguered guests were in ruins.

Of course, Motherwell had found themselves in a similar position last weekend and turned a 2-0 deficit against Hibernian into a 3-2 victory. They should have been put to the sword just a couple of minutes after the break last night, however, but McGinn's low strike was superbly saved by Darren Randolph.

That escape seemed to galvanise Motherwell and last week's match winner, McHugh, was plunged into the fray to bolster the salvage operation. The striker should have reduced the deficit on 75 minutes when he blazed over when clean through, but he made his mark two minutes later as he battered a close-range strike in off the underside of the bar.

That prompted a quite frenzied finale as Motherwell launched a wave of furious assaults while St Mirren were forced into the kind of desperate rear-guard action on a par with Custer's last stand. Defensive bodies were thrown about like rag dolls – Lee Mair made two heroic interventions in quick succession – as the hosts repelled the late bombardment. "It was a siege and how we never got an equaliser, I'll never know," said Stuart McCall, the Motherwell manager.