NEW YORK — After one set, Andy Murray slammed his racket into the court, then mangled it once he reached his chair on the sideline. After the second, he gestured over to his coach, Ivan Lendl, and let out a frustrated scream.

Stanislas Wawrinka had the U.S. Open defending champion in knots all day, and when the surprisingly short, less-than-competitive match was finished Thursday, Murray was a 6-4, 6-3, 6-2 upset loser in the quarterfinals at Flushing Meadows.

“I would have liked to have played a little bit better,” Murray said after rushing off the court and into the interview room to explain the loss. “I’ve had a good run the last couple of years. It’s a shame I had to play a bad match today.”

Ninth-seeded Wawrinka made his first Grand Slam semifinal, earning a spot in the final four for Switzerland that for so long felt like Roger Federer’s birthright.

“It feels amazing for sure, especially here,” said Wawrinka, who didn’t face a break point over his 14 service games. “Especially after that match. He’s the defending champion, He’s a tough opponent.”

The third-seeded Murray won his first Grand Slam title at Flushing Meadows last year, then his second at Wimbledon this July.

But the straight-set loss to Wawrinka ended a stay in New York during which he never got completely comfortable — not when he had to wait until the first Wednesday to begin defense of the title, not when he struggled in a four-set victory over Denis Istomen in the fourth round and certainly not Thursday.

This was Murray’s earliest exit from the U.S. Open since 2010, when Wawrinka also did the honors — that year in the third round.

Murray conceded it’s been a long road since he broke into the top, first at the Olympics on home turf last year, then with the two major titles.

“When you work hard at something for a lot of years, it’s going to take time to fire yourself up and get to training 110 percent,” Murray said about his preparation for the year’s final Grand Slam. “That’s something kind of natural after what happened at Wimbledon.”

An amazing letdown, especially considering the numbers he has been putting up of late.

—He had appeared in the finals of the previous four major tournaments he entered (he missed this year’s French Open because of a back injury).

—He had won 30 of his last 32 Grand Slam matches.

—He had been 7-0 on hard courts in major quarterfinals.

—This marked his first straight-set loss in a major since the semifinals of the 2011 French Open.

“If I’m meant to win every Grand Slam I play or be in the final, it’s just very, very difficult just now,” Murray said. “With the guys around us, it’s very challenging.”

Wawrinka is certainly one of those guys now.

He played near-flawless tennis, especially considering the windy conditions that had the ball warbling all over the place in Arthur Ashe Stadium.

Wawrinka had 45 winners to 15 for Murray.

His serve averaged 119 mph — 9 mph faster than Murray — and he won 37 of 42 points in which he got his first serve into play.

Wawrinka also charged the net, not allowing Murray to get comfortable while trying to figure out the windy conditions on the baseline. Wawrinka won the point on 31 of 42 trips to the net, including 10 for 10 in the third set.

“I thought there was a fair few long points, but I didn’t get into enough return games, which is disappointing for me,” Murray said. “That’s normally something I do pretty well. I always give myself opportunities to break serve, and I didn’t today.”