Del Potro, who had not reached the semifinal of a grand slam since winning the U.S. Open four years ago, is the second Argentine to reach the last four following David Nalbandian in 2002.
"I was really close," del Potro told reporters after being asked how close he was from retiring.
"I felt a lot of pain at the beginning of the match. It was exactly the same as before.
"It's really, really painful. I twisted my knee once again, but the doctor gave me some magic pills so I could finish the match. I'm so glad to go through."
Ferrer had problems of his own, revealing he was struggling with an ankle injury.
"I wasn't able to warm-up properly but it was fine during the match," he told reporters.
"I don't think his injury affected him. He was more focused and aggressive, served really well and deserved to win."