St Johnstone rode their luck in this fiercely-contested encounter with the last team to beat them in a league match at a chilly but bright McDiarmid Park.
The home side looked to have completely squandered a good opportunity to make up ground on Ross County and St Mirren in the race for the championship when they went two-nil down to a Paul Lovering free-kick four minutes into the second half.
Saints had been caught napping at the start of the first half, too. Keeper Matt Glennon parried a threatening, deep left-wing cross by Willie McLaren, but the ball fell to striker Stephen Twigg on the 18-yard line.
The former Derby County man almost unbelievably swung round with his back to the goal to curl the ball home from 18 yards to the astonishment of the home fans and the bemusement of the Saints' embarrassed defenders.
Ex-Saint Paul Lovering piled on the agony in the 49th minute when his driven free-kick deflected beyond the outstretched arms of the diving Saints keeper to put Airdrie two up.
What seemed to signal the death knell for Saints' league chances was matched by a goal after 61 minutes from Martin Hardie, who had seen a string of chances go begging. This time he made no mistake as he prodded home a Kevin James knock-down from Darren Sheridan'scorner.
And with time running desperately out for the Saints, James displayed real skill as he popped up to volley home from six yards.