While you have to give Barthel credit for finding a way to advance, she must be better with her serve if she's going to advance any further.
Still seeking her first tournament title since returning in 2018 from a long layoff that included a hard childbirth, the 37-year-old Williams showed excellent form at the start of Sunday's match.
Her opponent, 25-year-old Muguruza, noticed that something was awry with Williams too.
After Kozlova claimed a 3-2 advantage in the first set, Halep won three consecutive games to go to set point at 5-3 on Kozlova's serve.
Serena Williams of the United States reacts while being interviewed after her defeat in the Women's Singles finals match to Naomi Osaka of Japan on Day Thirteen of the 2018 US Open at the USTA Billie Jean King National Tennis Center on September 8, 2018 in the Flushing neighborhood of the Queens borough of New York City.
Williams had taken a 3-0 lead in the first set before losing the next seven games.
All 157 passengers on crashed Ethiopian Airlines flight killed
The plane, with a crew of eight and 149 passengers, was headed to Nairobi, Kenya , when it crashed at 8:44 a.m. local time. Ethiopian Airlines is one of the continent's biggest carriers with ambitions to becoming the gateway to Africa.
Williams, now ranked number ten in the world, has won a record 23 Grand Slam titles - one more than former record holder Steffi Graf.
"By the score it might have looked like I started well, but I was not feeling at all well physically".
Williams, who made the semifinals in the desert previous year, was playing McHale for the first time.
A two-time Grand Slam singles victor, the 25-year-old Spaniard now has a 3-3 record against Williams including a win in the 2016 French Open final and a loss in the 2015 Wimbledon final, but she said this victory didn't come with the usual sense of triumph.
Muguruza will now face either Kiki Bertens or Johanna Konta in the round of 16.
Venus Williams is turning back her own clock at the BNP Paribas Open, moving into the fourth round with a 6-2, 7-5 victory over qualifier Christina McHale.
After a first-round bye in Indian Wells, she beat Victoria Azarenka 7-5, 6-3 on Friday night.