Almagro had lost all 12 previous meetings with his Spanish compatriot before Tuesday and the mental baggage was apparent when he failed to serve out the match three times - once in the third set and then twice in the fourth.
By the fifth, Almagro was a psychological wreck and it was no surprise that Ferrer duly completed a gutsy 4-6 4-6 7-5 7-6 (7/4) 6-2 victory in three hours and 44 minutes to set up a last-four clash with the winner of Tuesday night's match between Novak Djokovic and Tomas Berdych.
"It was a miracle that I won this match," Ferrer said.
"Nicolas had a lot of chances to beat me but I tried to fight for every point - that is my game. I will always try to fight and do my best.
"In the important moments all the players get nervous, it has also happened to me."
Li Na made it through to her third Australian Open semi-final after halting Agnieszka Radwanska's blistering start to 2013.
Radwanska came into the match having won 13 straight matches, a run which included title wins in Auckland and Sydney, but she had no answer to Li's all-or-nothing game.
The Chinese won 7-5 6-3 despite making 40 unforced errors to advance to a last-four clash with Maria Sharapova.
Maria Sharapova continued her serene progress through the Australian Open field with a straight-sets demolition of Ekaterina Makarova.
The Russian has spent just five hours and 15 minutes on court so far in the tournament - an unprecedented run in Australia.
She insisted that despite the scoreline, beating Makarova is not easy.
"No matter what our record is, we always have close matches," she said. "It was quite close in the beginning today, we exchanged breaks of serves, but I think I ended up being the more aggressive player.
"Today [Tuesday] was a matter of staying focused because I know how excited she was to play me."