Fifth seed Daniil Medvedev feared he would not be able to continue against Stan Wawrinka before reaching his first Grand Slam semi-final at the US Open.
Medvedev, 23, received painkillers and taping on his thigh in the first set of a 7-6 (8-6) 6-3 3-6 6-1 victory over the Swiss on Arthur Ashe Stadium.
The Russian will face five-time champion Roger Federer or Grigor Dimitrov for a place in Sunday's final.
"For sure, I hope to be ready for the semis," Medvedev said.
"Before the match I was feeling perfect. In the first set I think I pulled my quadriceps. I had a really big pain and thought I wasn't going to continue the match.
"In the fourth set, I started feeling the painkiller and started moving better."
Medvedev, crowned Cincinnati Masters champion in August, seized the early initiative by breaking Wawrinka in the opening game - but struggled after receiving heavy strapping to his thigh during a medical timeout when 4-3 ahead.
Three-time Grand Slam champion Wawrinka, who reached the last eight after defending champion Novak Djokovic retired injured from their match on Monday, capitalised to level at 5-5, only for the stubborn Medvedev to close out a first set tie-break with three unanswered points.
With his movement improving, Medvedev broke serve in the fourth game to take the second set - although the momentum swung once more in the third as the Swiss 23rd seed raced into a 3-0 lead and saved two break-points to eventually serve out the set.
But the resilient Russian, booed in his fourth-round win over German Dominik Koepfer after teasing the crowd, rallied against the tiring 2016 champion and broke serve twice to seal his spot in the final four at Flushing Meadows.
Following his $9,000 (£7,400) fine for a visible obscenity and unsportsmanlike conduct in his third-round victory over Feliciano Lopez on Friday, Medvedev relished the boos that rang out when he arrived on court and during his post-match interview.
Asked to describe his relationship with the New York crowd, he said he had two words.
"The first is electric," he said after his quarter-final win. "And controversy, because what I've done is not good.
"So many people support me, so many people don't like me.
"I can just say, I try to be myself guys. I have to say, sorry guys, and thank you!"
Swiss great Federer, seeking a record sixth men's US Open singles title, is in action against Bulgarian Dimitrov in Tuesday's night session.