NEW YORK (AP) — 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.

"It's been a really great ride," Sharapova said.

"Ultimately, I can take a lot from this week," she continued. "It's great to get that major out of the way. It was an incredible opportunity. I'm very thankful for the opportunity."

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, a two-time Wimbledon winner, who eliminated reigning Wimbledon champion Garbine Muguruza 7-6 (3), 6-3 on Sunday night.

This is the most significant victory for Kvitova since she returned to action after needing surgery on her racket-holding hand for cuts from a knife-wielding intruder at her home in the Czech Republic in December.

"I came here without any expectations," Kvitova said.

Sharapova hadn't played in a major tournament since the Australian Open in January 2016, when she tested positive for the newly banned drug meldonium. She served a 15-month ban for that, returning to the tour this April with a ranking too low to get into Grand Slam events.

The French Open denied her a wild-card invitation, then she planned to try to qualify for Wimbledon before pulling out because of an injured left leg.

But she was able to enter the U.S. Open thanks to a wild card from the U.S. Tennis Association, which then proceeded to put its 2006 champion in Arthur Ashe Stadium every time she played over the past week, drawing strong support from spectators — and criticism from another former No. 1-ranked woman, Caroline Wozniacki.

On Day 1 of the tournament, Sharapova won a three-set thriller under the lights against No. 2 seed Simona Halep.

"Just competing, you know, being in that competitive environment — that's what I missed," Sharapova said. "You can't replicate that anywhere, especially at a Grand Slam. So ... Monday night was a special night for me. I will always remember it."

This time, Sevastova made Sharapova run a lot by pulling her forward with drop shots or tight angles, then would often deposit follow-up strokes into open spaces. On one point won by Sharapova in the second set, she twice tracked down lobs that she got back over the net by hitting the ball left-handed.

But she could not sustain enough strong play, and Sevastova reached the U.S. Open quarterfinals for the second consecutive year.

"I allowed the match to become physical," Sharapova said about the late-going. "I don't think I played as aggressive or was stepping in as much as I did in the first set."

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, while No. 17 Sam Querrey of the United States takes on No. 28 Kevin Anderson of South Africa. Querrey gave the host nation its first male quarterfinalist in New York since 2011 by compiling 55 winners and only eight unforced errors while easily beating No. 23 Mischa Zverev 6-2, 6-2, 6-1.

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."

_

Follow Howard Fendrich on Twitter at http://twitter.com/HowardFendrich

_

More AP tennis coverage: https://apnews.com/tag/apf-Tennis