Match ends, Livingston 1, Rangers 0.
Steven Gerrard sustained just his second defeat in 18 games as Rangers manager as promoted Livingston stunned the Ibrox side in West Lothian.
Dolly Menga's strike proved to be the difference as Gary Holt's side moved level with Hibernian in second.
Gerrard's side remain without an away win in the Premiership this season and face leaders Hearts, who they trail by eight points, next Sunday.
Before then, Rangers host Rapid Vienna in the Europa League on Thursday.
Livingston, meanwhile, extend their unbeaten in the division to six games, with head coach Holt still to taste defeat since replacing Kenny Miler last month.
Holt's team should have been ahead long before they scored. Scott Robinson was through but dragged his effort across the face of goal and Alan Lithgow could only direct his sliding effort wide after latching on to Craig Halkett's header.
The hosts were content to let Rangers play in front of them, knowing they could trouble the visitors at set pieces.
And so it proved after Rangers conceded a free-kick near the halfway line with Livi playing the ball long and Declan Gallagher and Robinson combining to set up Menga, who took a touch and scored.
By that stage Rangers had dominated possession but had found the home defence impenetrable and goalkeeper Liam Kelly was largely untroubled,
That pattern continued into the second half, though Alfredo Morelos did force a save from Kelly.
Scott Pittman was denied by the feet of Rangers keeper Allan McGregor and Lithgow stylishly flicked wide from another Livingston set play.
Crosses continually came into the Livi box and were continually cleared and penalty claims for Halkett's challenge on substitute Glenn Middleton then handball were waved away by the referee on a frustrating day for the visitors.
BSports Scotland's Alasdair Lamont at the Tony Macaroni Arena
A phenomenal performance and result for Livingston. To a man, they were excellent, continuing to exceed expectations on this upward trajectory.
Their style of play and personnel has scarcely changed over their promotion push and return to the top flight, but great credit has to go to Holt for the way he has galvanised the team since his arrival.
He had so many heroes this afternoon. Captain Halkett was immense, marshalling a superbly-organised defence, while Menga kept Connor Goldson and Joe Worrall on their toes throughout.
Rangers were short of inspiration, though. As good as they have been at times under Gerrard, they fell well short of those standards.
Their final ball was lacking - only once did they cut the home side open, but Morelos could not find the equaliser.
It is something of a wake-up call for Rangers, who find themselves in mid-table and must quickly pick themselves up for the visit of Rapid Vienna on Thursday.
Match ends, Livingston 1, Rangers 0.
Second Half ends, Livingston 1, Rangers 0.
Keaghan Jacobs (Livingston) wins a free kick on the left wing.
Foul by Borna Barisic (Rangers).
Substitution, Livingston. Craig Sibbald replaces Scott Robinson.
Hand ball by Joe Worrall (Rangers).
Foul by Shaun Byrne (Livingston).
Joe Worrall (Rangers) wins a free kick in the defensive half.
Scott Robinson (Livingston) wins a free kick on the left wing.
Foul by Joe Worrall (Rangers).
Corner, Rangers. Conceded by Declan Gallagher.
Attempt missed. Alan Lithgow (Livingston) header from the centre of the box is close, but misses to the left.
Nicky Cadden (Livingston) wins a free kick on the right wing.
Foul by Borna Barisic (Rangers).
Attempt missed. Ovie Ejaria (Rangers) header from the centre of the box is just a bit too high.
Corner, Rangers. Conceded by Alan Lithgow.
Bobby Burns (Livingston) is shown the yellow card for a bad foul.
Foul by Bobby Burns (Livingston).
Alfredo Morelos (Rangers) wins a free kick in the defensive half.
Substitution, Livingston. Steve Tevi Lawson replaces Dolly Menga.
Foul by Alan Lithgow (Livingston).
Alfredo Morelos (Rangers) wins a free kick in the defensive half.
Craig Halkett (Livingston) wins a free kick on the left wing.
Foul by Alfredo Morelos (Rangers).
Attempt saved. Ryan Kent (Rangers) right footed shot from outside the box is saved in the centre of the goal.
Attempt missed. Alan Lithgow (Livingston) header from the centre of the box is close, but misses to the left.
Corner, Livingston. Conceded by Allan McGregor.
Attempt saved. Scott Pittman (Livingston) right footed shot from the right side of the box is saved in the bottom right corner.
Foul by Scott Pittman (Livingston).
Daniel Candeias (Rangers) wins a free kick in the defensive half.
Foul by Ricki Lamie (Livingston).
Daniel Candeias (Rangers) wins a free kick in the defensive half.
Substitution, Rangers. Glenn Middleton replaces Kyle Lafferty.
Substitution, Livingston. Bobby Burns replaces Steven Lawless.
Dolly Menga (Livingston) wins a free kick in the defensive half.
Foul by Joe Worrall (Rangers).
Delay over. They are ready to continue.
Foul by Alfredo Morelos (Rangers).
Shaun Byrne (Livingston) wins a free kick in the attacking half.
Foul by Alfredo Morelos (Rangers).