NEW YORK — Maybe this was just one three-setter too many for Maria Sharapova.

Sharapova tried a bit of everything, even resorting to switching over her racket to hit a few lefty shots. Still, the five-time major champion could not quite keep her Grand Slam comeback from a doping suspension going, losing in the fourth round of the U.S. Open to 16th-seeded Anastasija Sevastova of Latvia 5-7, 6-4, 6-2 on Sunday.

“Look, three-set matches are challenging. I love being part of them. There’s an element of concentration, focus, physicality that goes into all of it. And you have to put it all together. Yeah, you just have to get through it,” Sharapova said. “There’s no doubt that not playing those matches certainly cost me today. I did feel like I was thinking a little bit too much and not playing by instinct.”

This was the third time in her four matches that Sharapova went the distance and she faded down the stretch, while also dealing with a blister on her right hand that was treated and taped by a trainer in the final set. Sharapova’s miscues kept closing exchanges, and she dropped 13 of the first 14 points in that set.

The 30-year-old Russian finished with 51 unforced errors, compared to 14 for Sevastova.

Sharapova’s exit leaves Venus Williams as the only past U.S. Open champion in the women’s field . The 37-year-old Williams, who won the title in 2000 and 2001, got to the quarterfinals by beating Carla Suarez Navarro 6-3, 3-6, 6-1. Next for Williams will be a showdown against No. 13 Petra Kvitova. In the second quarterfinal Sunday, Kvitova beat NO. 3 Garbine Mugurua 7-6 (3), 6-3. Kvitova owns two trophies from the All England Club.

Sevastova will face unseeded American Sloane Stephens, who reached her first quarterfinal in New York by eliminating No. 30 Julia Goerges 6-3, 3-6, 6-1. Stephens has won 12 of her past 14 matches, a remarkable run for someone who was off the tour for 11 months because of foot surgery in January.

Earlier Sunday, 18-year-old Canadian Denis Shapovalov’s entertaining stay ended with a 7-6 (2), 7-6 (4), 7-6 (3) loss to 12th-seeded Pablo Carreno Busta of Spain. In the quarters, Carreno Busta will play No. 29 Diego Schwartzman of Argentina.

Shapovalov was trying to become the youngest male quarterfinalist at Flushing Meadows since Andre Agassi in 1988, but he wasted a 5-2 lead and three set points in the opener, and finished with 55 unforced errors.

“Honestly, it was so much fun to be part of that atmosphere and the match and this whole two weeks,” Shapovalov said.

“You know, it’s another life-changing event for me.”