Glasgow Warriors fly-half Duncan Weir kicked 23 points as his side sent the Ospreys to their first defeat of the Pro12 League at Firhill.
The visitors led 12-6 at the break as visiting 10 Matthew Morgan kicked four penalties to Weir's brace.
But Weir drew their personal tallies level and after Ospreys hooker Richard Hibbard was sin-binned lock Richie Gray went over for the home try.
Morgan scored a late consolation try for the Welsh region.
Scott Johnson's side arrived with six league wins from six starts, but that counted for nothing against a determined Glasgow side who increased their intensity and effort after the break.
Scrum-half Chris Cusiter was in outstanding, man-of-the-match form in harness with fly-half Weir while lock Gray's presence also helped the hosts impose themselves as the game wore on.
Morgan's efforts included a shot from nine metres inside his own half, but his side's first-half lead came against the run of play.
Glasgow dominated the opening period in territory and possession, but every time Morgan had a chance to kick for goal, he took the opportunity.
Weir did likewise in that opening period, but the visitors' discipline in the face of the hosts' efforts held firm.
But Weir drew the teams level shortly after the break after Glasgow caught the Ospreys offside during a home attack in which Weir and Gray were prominent before wing Tommy Seymour's threat was snuffed out.
And when replacement hooker Richard Hibbard was sin-binned for coming in at the wrong angle at a ruck after an hour, the hosts took advantage.
Glasgow increased the pace of their attacks and towering lock Gray was judged to have touched down after being tackled and stretching every sinew to reach the line.
Weir converted and added penalties in the 67th and 69th minutes - the latter challenging Morgan's earlier long-shot for distance.
The Ospreys fly-half showed his attacking potential as he darted through with the last move of the game, but he was unable to convert.
Samoan pair Khan Fotuali'i and George Stowers made their Ospreys' debuts in the second half.
Glasgow: Hogg; Seymour, Dewey, Morrison, Shaw; Weir, Cusiter; Reid, MacArthur, Cusack, Gray, Ryder, Harley (capt), Fusaro, Wilson.
Replacements: Aramburu for Seymour (58), Nathan for Dewey (70), Gregor for Cusiter (74), Kalman for Reid (31), Hall for MacArthur (49), Eddie for Ryder (67), Barclay for Fusaro (49).
Not Used: Hunter.
Ospreys: Fussell; Bowe, Parker, Bishop, E Walker; Morgan, Webb; D Jones, M Davies, Griffiths, Gough, Evans, Smith, Bearman, J Thomas (capt).
Replacements: Beck for Parker (65), Dirkson for E. Walker (74), Fotuali'i for Webb (43), Bevington for D Jones (63), Hibbard for M Davies (43), Jarvis for Griffiths (49), Stowers for Gough (56), King for Smith (70).
Ref: Carlo Damasco (Italy).