The 4-4 aggregate result, coming after last week's first leg in Barcelona finished 3-2, prompted wild celebrations at the club's 6,000-capacity stadium in Miranda de Ebro and set up a semi-final against Athletic Bilbao or Real Mallorca.
It was only the second time a team from the third level of Spanish football has reached the last four of the cup, as Mirandes, who have an annual budget of just over 1.2 million euros, followed up their unlikely successes against La Liga clubs Villareal and Racing Santander with another heroic display.
"This is amazing," captain Pablo Infante, a local bank employee who netted the equaliser and provided the assist for the dramatic winner, told Spanish television.
"Tomorrow I have to go to work but we are going to celebrate a bit first," he added.
Espanyol came from two goals down to win the first leg at their Cornella home and looked to be cruising when Rui Fonte made it 1-0 and 4-2 on aggregate shortly after half-time.
Infante levelled with just over half-an-hour left and the home side made a mockery of their humble status by laying siege to the Espanyol goal in the final stages before Cesar netted the crucial goal in the second minute of added-time.
Fans spilled onto the pitch to celebrate with their heroes and the victory prompted messages of congratulation from Spanish internationals including captain Iker Casillas, defender Gerard Pique and midfielder Cesc Fabregas.
"Incredible. I am speechless. Spectacular, that's what football is all about," Fabregas wrote on his Twitter feed.
Bilbao are Mirandes's likely opponents in the last four after they beat La Liga rivals Real Mallorca 2-0 at the San Mames last week, with the return leg in Palma on Wednesday.
On the other side of the draw, holders Real Madrid need to overturn a 2-1 deficit when they play at 2011 runners-up Barcelona later on Wednesday.
The build-up to the game has been overshadowed by the controversy surrounding Pepe's alleged stamp on the hand of Barca's World Player of the Year Lionel Messi during the first leg in Madrid.
The Portuguese international said it was unintentional and the Spanish football federation (RFEF) took no action, meaning he is free to play at the Nou Camp if fit.
If Barca eliminate their arch rivals they will probably face Valencia, who beat Levante 4-1 in their quarter-final first leg and play at their city neighbours on Thursday.
Get the best features, fun and footballing frolics straight to your inbox every week.
Thank you for signing up to Four Four Two. You will receive a verification email shortly.
There was a problem. Please refresh the page and try again.