NEW YORK — Defending champion Rafael Nadal shockingly was shut out in the first set of his U.S. Open quarterfinal before coming back to beat No. 9 seed Dominic Thiem 0-6, 6-4, 7-5, 6-7 (4), 7-6 (5) in 4 hours, 49 minutes.

It was only the fourth time in 282 career Grand Slam matches that Nadal lost a set by a 6-0 score. It’s the first time he won the match after that kind of start.

This one was never easy: Nadal trailed by a break in the third set before taking it. He came within two points of victory late in the fourth set before being pushed to a fifth, where he was two points from a loss.

But Nadal held on and is into the semifinals at a third consecutive major tournament as he bids for a fourth U.S. Open title and 18th Grand Slam trophy overall.

He’ll face 2009 champion Juan Martin del Potro next.