YOKOHAMA, Japan — They jetted over here and got sort of lost in stagnation, then eked into the Olympic quarterfinals looking blah, then found their quality Friday night, then saw their opponent find its quality, then mustered on toward penalties while having enough goals nixed by offsides — four! — that it looked like some sort of goofball offsides clinic.

And then look here, they’re still going. The United States women’s national soccer team carries on because the seen-it-all goalkeeper Alyssa Naeher stopped one penalty in the 81st minute and two in the shootout, including a lid-lifter from the great Vivianne Miedema. It carries on because Megan Rapinoe smashed one last penalty rightward and upward to the roof to make it 4-2 on penalties after 2-2 in the fray with the Netherlands. And it carries on because it knows how, even as it just treated those who care to palpitations.

“Aw, you guys aren’t surprised,” Rapinoe said to laughter among the reporting corps. “Come on. This is who we are.”

“This team, you know, we always believe we’re going to find a way to win,” Naeher said, “and I think you saw that tonight.”

“The beauty of this team is when things aren’t going right, we’re still getting results,” said Lynn Williams, the surprise starter who excelled early on.

So while the tournament loses an astonishing star in Miedema, who scored an are-you-kidding 10 goals in four matches here, the United States traipses on to a semifinal against Canada on Monday, its chance at that World Cup-and-Olympics, 2019-and-2021 double still afloat.

How that thing did teeter at times.

At first, after the 3-0 drubbing by Sweden on July 21 and the 6-1 recovery against New Zealand on July 24 and the 0-0 slog with Australia on July 27, the Americans did look their merry old selves on July 30 “from the first second,” as manager Vlatko Andonovski put it. They imposed. They hit the post with Lindsey Horan’s header off Williams’s wondrous cross. They even claimed their first disallowed goal and whopping sixth of the tournament, by Tobin Heath, the details pretty but irrelevant.

In fact, they kept things so tilted their way early that it seemed Naeher could have brought along a cot and napped in the back, even in the humidity. Then the ball did roam toward her in the 18th minute, and it got way too much time bouncing and basking around the box, with Samantha Mewis stopping one shot, until it caromed to Miedema. When she wheeled around blindly but surely amid the box and sent one burning through the grass inside the left post, the Dutch had done little, but led 1-0.

The Americans had reason to fret but, of course, didn’t. They dug out more of their superior skill and benefited from Williams, who had been “devastated” at not quite making the 2019 team and bummed at starting out at as an alternate for this. Of the starting nod Friday, she said, “First of all, I was in shock.” In the game, she shone.

“People dream about this moment,” she said later on.

In the 28th minute, her North Carolina Courage teammate Mewis fed her the ball near the top right corner of the box, whereupon Williams used her various talents to lose the defender and cross the ball, whereupon Mewis moved up to head it in. In the 31st minute, off a corner kick from Heath, Williams headed the ball toward the goal, got it headed back, collected it again and boomed it into the back left corner of the net.

“We have a lot of people on the field who work in tight spaces,” said Williams, a 28-year-old from Fresno, Calif., soon adding, “What makes me special is my ability to get behind people, so why not do what I’m good at?”

In a world of 2-1 leads of various tenors, this one seemed free of discomfort. If only the empty seats that filled International Stadium weren’t inanimate and could savor athletic artistry. The Americans looked set.

Then, after halftime, they played like they might have had that perilous thought themselves. Their passes got messy.

“From shortly before halftime,” the Netherlands’ Lieke Martens said, “actually I felt that we grew in the game and we dominated most of the second half.”

Things tilted orange. Miedema rocked in a second goal in the 54th minute. Naeher had to sweat more.

The American mainstays who had begun as subs came on in the 57th and then 64th minute — Alex Morgan, Rose Lavelle, Christen Press, Rapinoe — and Andonovski would point out that those four players took the four penalties later on. But there was one different breed of penalty to go before that. A commotion in front of the U.S. goal in the 80th minute saw the Netherlands’ Lineth Beerensteyn spill in the close company of two Americans, and a return flight to the United States did seem nigh.

Martens set to take it as officials reviewed it, Naeher set to defend it. “Just tried to stay in the moment,” Naeher said. “Focus on the ball. A couple deep breaths. And just let instincts take over. Stay in the moment as much as I could.”

Off it went, not the best penalty in the history of the sport. Naeher moved to her left to save and could have held a cocktail while doing so (not that she would). From there, you could almost smell the shootout coming.

It came even through two more offsides on U.S. goals in extra time, and one for the Netherlands. (“A couple toenails offside,” Rapinoe described it all.) It came after Naeher made a diving save on a Miedema header. It came in an empty stadium, which is weird but then, as Rapinoe said, they’re used to it.

While Naeher could hear her teammates’ encouragement across an empty stadium, Miedema started off and directed one to the left edge of the goal. Naeher stretched out and ruined it.

“There’s no one else I would rather have back there,” Lavelle said.

“She’s just been immense,” Rapinoe said.

“That calmness,” Williams said. “I don’t know how she does it. I’m amazed.”

The best of all her U.S. games? “I’ll leave that to you guys,” Naeher said. “I don’t know about any of that.”

From there it went Lavelle to the high left side, Morgan across the ground to the left, Press with an easy plunk into the left and then, after Naeher’s easy save on Aniek Nouwen, here came Rapinoe, who bashed it in to the right while goalkeeper Sari van Veenendaal toppled the other way. Then Rapinoe turned around and folded her arms, having no crowd for her trademark World Cup outstretch pose.

“That was two thousand nineteen,” she said. “There’s no people [this time], you know.”

But she said of penalties, “No, I just try to be calm. I always say, ‘The worst that’s gonna happen is you’re gonna lose the whole thing.' ” Her listeners laughed, and she said, “I know, it is, like, you could lose the Olympics for your country.” Her listeners laughed again, their grind through Japan having come to a bed of laughter. — Chuck Culpepper

Read below for highlights from the match.