Inter crashed out of the Coppa Italia as Stefano Pioli was haunted by former club Lazio, who claimed a 2-1 quarter-final victory at San Siro.
The hosts came into the tie on a nine-match winning streak and Lazio had lost two straight games, but the form book was turned upside down in a match that saw both sides finish with 10 men.
Felipe Anderson headed in his third goal of the season in the first half as Serie A's fourth and fifth-placed teams did battle in the cup.
And Lucas Biglia struck with a second-half penalty after Miranda had been sent off for a foul on Ciro Immobile.
Inter had hopes of a comeback when Stefan Radu received a second yellow for the visitors and Marcelo Brozovic struck with a late header, but Lazio survived.
Lazio, who are now one step away from a third Coppa Italia final in five years, will face either city rivals Roma or second-tier Cesena in the semi-finals.
Pioli's men, meanwhile, are still waiting for a first final appearance since 2011 and their sole focus for the rest of 2016-17 will be on Champions League qualification.
Inter made the stronger start, Ivan Perisic firing narrowly wide before Geoffrey Kondogbia - in as one of five changes - sent a drive against the foot of the post after Biglia had lost possession in a dangerous area.
But it was Lazio who took the lead against the run of play after 20 minutes. Senad Lulic sent in an inswinging cross from the left and Anderson escaped the attention of Cristian Ansaldi to guide a deft header into the far corner.
2 - Felipe Anderson has now scored his only 2nd headed goal for Lazio, out of 24 netted in total. Fresh. #InterLazio-- OptaPaolo (@OptaPaolo) January 31, 2017
Simone Inzaghi's men were buoyed by the opener and should have doubled their lead with two golden chances before half-time.
First, Immobile, who was returning to the side as part of four alterations for the visitors, blazed over after Miranda's mistake had presented with him a superb chance.
Anderson was then sent clean through by Radu, but somehow failed to beat Samir Handanovic one-on-one, the goalkeeper making a crucial save.
At the other end, Federico Marchetti saved from Brozovic, while Antonio Candreva had a strong penalty claim turned down after he was challenged by both Patric and Marco Parolo.
Pioli made a double half-time change with captain Mauro Icardi and Joao Mario brought on, but Lazio soon squandered another great opportunity as Parolo fired over from inside the six-yard box after Handanovic parried Wesley Hoedt's header.
The second goal was coming and it arrived from the penalty spot after 56 minutes. After Joao Mario lost possession, Alessandro Murgia's floated pass released Immobile, who was felled by Miranda as he prepared to shoot.
That saw the defender sent off and Biglia confidently dispatched the resulting spot-kick into the top corner.
Inter did not give up with 10 men - Jeison Murilo missed the target with a free header and Icardi had an aerial effort of his own deflect inches wide.
But Lazio remained a threat, Anderson's mixed night continuing when he collected Lulic's pass and finished poorly off-target with only Handanovic to beat.
Radu saw red with 14 minutes to play after he fouled Icardi having already been booked in the first half and Brozovic headed in impressively with six minutes to play after Perisic had diverted Candreva's cross into his path.
But it proved just too late for Inter as Lazio held on under intense late pressure.