NEW YORK — Naomi Osaka spiked her racket after one errant forehand late in the second set at the U.S. Open, then flung it the length of the baseline after a missed backhand return ceded that tiebreaker.

Sometimes, that’s the sort of reaction it takes to right things for Osaka.

And, perhaps surprisingly, she needed whatever push she could get in this third-round match.

Facing an opponent competing in just her second major tournament, two-time Grand Slam champion Osaka eventually figured out a way to turn a tight one into a runaway and beat 18-year-old Marta Kostyuk 6-3, 6-7 (4), 6-2 by claiming the final five games Friday at Flushing Meadows.

“While I was playing, honestly, I was cursing myself out,” Osaka said during an on-court interview afterward, “so you wouldn’t want to know what I was saying.”

Still, she improved to 7-0 since tennis resumed after a hiatus of more than five months because of the coronavirus pandemic.

Another past U.S. Open champion moving into the fourth round Friday was 2016 titlist Angelique Kerber, who defeated 20-year-old American Ann Li 6-3, 6-4. Kerber’s next opponent is another American, 28th-seeded Jennifer Brady, a 6-3, 6-3 winner against Caroline Garcia.

In the previous round, Garcia upset top-seeded Karolina Pliskova.

With shadows creeping across the Arthur Ashe Stadium court in the early afternoon, the 137th-ranked Kostyuk certainly had her chances to pull off a significant surprise, too.

The key moment: Kostyuk held five break points that could have given her a 3-1 lead in the final set.

But Osaka fended off every one and held to 2-all, beginning her match-closing run.

“I’m kind of scared how she’s going to be in the future,” said Osaka, who played with tape wrapping her left hamstring, which has been a problem since last week. “She has no fear.”