A 66th-minute Charlie Wyke strike meant Town headed into added time trailing.
But a 93rd-minute Mickey Demetriou header pulled them level before James Collins snatched all three points a minute later to spark wild scenes at Brunton Park.
Boss Micky Mellon made two changes from the side that secured the 1-1 draw against Southend.
In came striker Tyrone Barnett for his full debut following his goalscoring heroics against the Shrimpers.
There was also a recall for defender Jermaine Grandison in the absence of the injured Nat Knight-Percival.
For Carlisle, midfielder Anthony Griffith was named in Keith Curle's starting XI after joining the Cumbrians from Shrewsbury in January.
And it was the home side who made a flying start to the match when Steven Rigg came close to opening the scoring inside the first two minutes.
A long throw fell kindly to the midfielder inside the box and he hit a low shot which Jayson Leutwiler did well to push for a corner.
Town were slow to get going and they were given another warning when Anthony Sweeny brilliantly slipped in Charlie Wyke.
With the striker bearing down on goal, Leutwiler raced off his line to smoother – with the linesman later waving his flag to signal Wyke was offside.
All the momentum seemed to be with the Cumbrians but Town hit back with Cameron Gayle sending in a teasing cross which Liam Lawrence volleyed wide.
But it was Curle's side who were continuing to press and they would have taken the lead on 20 minutes but for the heroics of Leutwiler.
First, the goalkeeper parried clear a Brad Potts half-volley from inside the box before getting back to his feet and tipping a Griffith piledriver from 25-yards onto the bar.
It was two brilliant stops from the former FC Basle star with the second likely to go down as his save of the season.
The game had suddenly become a scrappy affair with the quality of football summed by a chance which fell to James Collins on 35 minutes.
After Shrewsbury gave the ball away, Potts then inexplicably gave it back by passing to Gayle.
The wing-back took the ball inside the box and cut it back to Collins, but Town's top scorer side-footed wide when he should have done better.
Town had their best chance of the half just before half-time with Bobby Grant twisting and turning his way into the box.
But after working himself into a good position, the creative schemer crossed for Collins when he should have put his laces through it and his delivery was cleared by Griffith.
Unhappy with what he had seen, Mellon made a change at half-time, introducing Scott Vernon for Gayle.
It meant Town lined up with a midfield diamond with Ryan Woods at the base, Vernon at the tip and Lawrence and Grant in the middle.
And the changes almost had the desired impact inside the first few minutes with Collins seeing a low drive well held by Mark Gillespie.
Suddenly it was all Shrewsbury and Grant should have opened the scoring when he expertly worked himself some space in the box before blazing over from 12-yards.
Town where now piling forward and Grandison saw a header cleared off the line from a corner.
And the chances continued to come with Collins nipping the ball past a defender and racing in on goal.
With only the keeper to beat, the striker hit a low shot which Gillespie saved much to the annoyance of Lawrence who was waiting for a tap in.
It was a miss that proved to be costly when Carlisle went up the other end and scored against the run of play.
After a corner was cleared, a long ball into the box seemed to catch the Town defence by surprise and Wyke fired home.
Wyke should have then doubled the lead minutes later when he blazed over with the goal at his mercy after a good pull back from David Amoo.
Mellon responded by introducing Jean-Louis Akpa-Akpro for Barnett and then Jordan Clark for Grant.
And Shrewsbury incredibly went onto win the game deep into four minutes of stoppage time.
With everyone waiting for the whistle to blow, Demetriou headed home from a corner.
Town then immediately won the ball back from the kick-off with Jean-Louis Akpa Akpro breaking down the left flank.
His cross fell kindly for Collins who fired home from 12-yards.
The goal was met with a deathly silence around Brunton Park while Mellon and the Town bench celebrated the unlikeliest of victories.

. 4a399965-399a-4f17-ad45-6bf3746fde71.jpg

5. 51eff07e-7b11-4b85-932b-7ac63aa56c56.jpg

6. 77570720-3e9d-496e-92e6-bce2b7673740.jpg

7. 1fccaaa2-4197-4d97-83e8-197706a1f535.jpg


