Nottingham Forest hung on to beat Stoke 3-2 in a pulsating Carabao Cup third-round tie at the City Ground to book their first fourth-round spot for 14 years.

Forest were 3-0 up after 50 minutes as goals from Simon Osborn, Daryl Murphy and Joe Lolley put them firmly in the driving seat, but Benik Afobe pulled a goal back before the Reds were reduced to 10 men when Diogo Goncalves was sent off.

Saido Berahino then set up a frantic last few minutes with a second Stoke goal, but Forest rode out the storm to clinch a third straight victory.

After a cagey opening, Stoke had the ball in the net after 12 minutes when Bojan Krkic fired Peter Crouch’s lay-off past Luke Steele in the Forest goal, but the flag had already been raised for offside.

Krkic then fired a 20-yard shot narrowly over the crossbar, before Forest responded with their first effort on goal in the 18th minute, Gil Dias bringing a save out of Adam Federici.

A minute later, Forest went ahead in the most fortuitous of circumstances with Osborn opening the scoring.

The Reds left-back attempted to get on the end of a through ball and as Federici came out to clear, the Stoke goalkeeper thumped the ball against Osborn and then watched as it rebounded past him into the net.

Goncalves toe-poked an effort wide before he and Lolley combined beautifully down the left, with the latter’s shot saved by a diving Federici who then got down low to thwart the Portuguese.

Forest doubled their lead six minutes before the break when Murphy burst forward and unleashed a stunning effort that crashed in off the underside of the bar.

Goncalves and Lolley combined again early in the second half but Lolley was once more denied by Federici

Lolley finally got the goal he deserved as Dias put him in down the right, he cut into the box and curled a low shot into the far corner.

Stoke pulled a goal back on the hour mark as Forest were caught napping, with sub Afobe firing home just five minutes after being introduced.

Charlie Adam nearly caught out Steele from the halfway line, but his ambitious effort dropped just wide, before Afobe struck the bar from Bojan’s cross as the Reds switched off again.

Goncalves had another effort saved by Federici, before the Portuguese midfielder was shown a straight red with quarter of an hour to go for a foul on Tom Edwards.

Referee Darren England had initially let the challenge go only to stop play following an angry outburst from the Stoke coaching staff.

Berahino reduced the deficit to one after 82 minutes, forcing home from close range, but he then missed a sitter, heading Tom Ince’s inch-perfect cross wide from six yards.