Rovers booked their place in the fifth round of the FA Youth Cup in dramatic fashion on Monday evening.
A goal in the 120th minute from substitute Joel Steer saw Rovers progress on an entertaining night at Leigh Sports Village.
Josh Felix-Eppiah gave Leicester City the lead early on but Rovers levelled just before the break as Joe Rankin-Costello got the final touch to a Lewis Mansell header that hit the crossbar.
Then after hitting the woodwork in the second half, Rankin-Costello found the back of the net five minutes into extra-time with a superb solo effort.
However Rovers' lead only lasted two minutes when Kairo Mitchell snapped up a chance after Andy Fisher had spilled a shot, and the game looked to be heading to penalties when Tre Pemberton saw a diving header strike the upright.
But in the dying seconds a storming run from man-of-the-match Rankin-Costello saw him take the ball into the box before teeing up Steer to fire home.
The victory means an away tie against Aston Villa in round five.
Billy Barr made two changes from the side that defeated Southend United in round three.
After his successful loan spell at Salford City, Lewis Hardcastle returned to start for the Under-18s, replacing Stefan Mols. And with Josh Askew suspended following his red card the previous round, Lewis Travis took his place at left back.
It was a fast and frenetic start under the lights at Leigh as Rovers started strongly, showing good composure in possession and energy when out of it.
But after Joe Rankin-Costello saw a header cleared off the line on 12 minutes, it was the Foxes who went straight up the other end to take the lead.
Forward Kairo Mitchell's ball across the area was only parried by Rovers keeper Andy Fisher and Josh Felix-Eppiah poked home the rebound.
Rovers responded well with Ramirez Howarth firing narrowly wide, but Leicester should have doubled their advantage on 18 but Mitchell was just off target with a shot across the box.
After seeing another header cleared off the line, Rovers finally made one of their corners count with the equaliser on 40 minutes.
Willem Tomlinson delivered from the right, Lewis Mansell rose high to head goalwards and as the ball bounced down off the underside of the bar Rankin-Costello made sure on the goal-line.
Leicester looked to regain their advantage ahead of the break but a back-pedalling Fisher tipped over a looping effort from the lively Hamza Choudhury.
The visitors claimed the first chance of the second half with Fisher denying Admiral Muskwe at the near-post, before Scott Wharton headed wide when well placed.
But on 55 minutes Rovers should have been in front. A trademark shot from distance by Tomlinson was spilled by Cameron Yates in the Leicester goal but inexplicably Mansell fired the rebound over the bar from inside the six-yard box. The young forward has been in fine form this season for both the Under-18s and Under-21s but on this occasion that predatory touch eluded him.
There were less chances in the second half as the two hard-working sides cancelled each other out, but it was the Rovers with the better of them in the closing stages.
After Hardcastle put a free-kick a whisker wide, a ball threaded through saw Mansell give chase but a superb block from Choudhury prevented the striker from getting his shot on target.
Rovers then went closer sixty seconds later when Rankin-Costello let fly from distance, but his deflected strike crashed off the crossbar meaning extra-time would be required.
Having ended the second half strongly, Rovers maintained their forward momentum at the start of the additional 30 minutes.
Rankin-Costello went close on 95 with a shot that needed Yates to save, but the young midfielder would make no mistake two minutes later.
Collecting the ball on the edge of the box, Rankin-Costello ran at the Leicester defence before cutting inside and steering his effort into the far corner of the goal to put the home side in front for the first time on the night.
There had been some question over who scored Rovers' first goal of the evening, but there was no doubt on this occasion thanks to his fine solo goal.
However Rovers' lead would last barely two minutes as the Foxes got straight back on level terms.
Andy Fisher couldn't hold a tame shot from substitute Harvey Barnes and Mitchell forced home the rebound.
Rovers should have gone back in front but were denied by the woodwork once more.
On 112, Lewis Travis saw his deep cross elude Mansell, with Tre Pemberton unfortunate to see his diving header strike the corner of post and bar.
Mansell would soon depart to be replaced by Joel Steer.
But with penalties looming large, the match would end in dramatic fashion. A surging run from Rankin-Costello took him from the centre of the park down the left before he cut in from the byline and teed up Steer to fire home from mere yards out to spark jubilant scenes amongst the home support.
Leicester threw everyone forward in the final seconds, but Rovers' held their nerve to triumph in what had been a pulsating cup tie.
Rovers' reward is a fifth round tie away at Aston Villa.
ROVERS: Fisher, Nyambe (sub Magloire 105+2 mins), Wharton (c), C. Doyle, Travis, Rankin-Costello, Hardcastle, Tomlinson, Pemberton, Howarth (sub Fawns 82 mins), Mansell (sub Steer 113 mins).
Subs not used: Ascroft (GK), Grayson.
Goals: Rankin-Costello 40, 97 mins, Steer 120 mins.
Booked: Rankin-Costello, Hardcastle
LEICESTER: Yates, Percival (sub Pascanu 114 mins), Kelly, Choudhury, Knight, Johnson (c), Muskwe, Ndukwu, Mitchell, Fura, Felix-Eppiah (sub Barnes 69 mins).
Subs not used: Slinn (GK), Kaba-Sherif, Dewsbury-Hall.
Goals: Felix-Eppiah 13 mins, Mitchell 99 mins