Funny how one set of penalty kicks — icy execution in eerie silence as early-rising fans back home watched in fright — turned not only the gold medal outlook for the U.S. women’s national soccer team Friday but the feeling about the program.

Had the shootout with the Netherlands on Friday not gone the Americans’ way, had Alyssa Naeher not made two saves — on top of the one late in regulation — and her teammates not converted every attempt, Coach Vlatko Andonovski might have been out of a job upon his return stateside and several players perhaps would have started preparing retirement speeches.

The Americans, two-time reigning World Cup champions and top-ranked for four years, have teetered throughout the Olympic tournament. They lost badly, won easily (against a lightweight) and played to a sleepy draw. Almost everything has been a struggle.

Sweden and the Netherlands were the new favorites. Time was suddenly passing on the United States, which, until a week ago, had gone 2½ years without losing.

The Americans found themselves in a heap of quarterfinal trouble against the Dutch, the 2019 World Cup runner-up featuring extraordinary striker Vivianne Miedema. They fell behind in the first half and endured scares throughout the night in Yokohama.

In the shootout, the Americans cast aside what plagued them over 120 minutes — attacking lulls and defensive hiccups — and displayed the steely resolve that has helped define the most decorated team in the women’s game. Full of skill and promise, the first-time Dutch Olympians were not ready for the moment.

The U.S. roster is old, and age has perhaps contributed to the sluggish performances. At times, the team has looked every bit like a program in need of fresh faces. But age also carries experience, wisdom and confidence.

In the shootout, the Americans did not flinch. The Dutch cracked. Fittingly, 36-year-old Megan Rapinoe — hero of the 2019 World Cup and one of the oldest players on the roster — applied the finishing touches with an unstoppable shot.

This was a group that stared down France in Paris in the 2019 World Cup quarterfinals and has gone to battle with its employer, the U.S. Soccer Federation, over labor issues. A shootout in an empty stadium? That’s nothing.

Now, consider the Dutch in the tiebreaker. With the first attempt, Miedema failed to beat Naeher, who read it so well, she almost caught the ball in flight while diving to her right. Naeher also thwarted Aniek Nouwen in the fourth round. There would be no need for a fifth set of kicks after Rapinoe scored, securing a 4-2 outcome following the 2-2 draw.

One could not help but wonder about the Dutch mind-set after watching Naeher stop Lieke Martens’s poorly directed penalty kick in the 81st minute. Had Martens scored, the Americans were probably out in the quarterfinals for the second consecutive Olympics, embarrassing outcomes after filling a trophy case since 1991. Instead, the FC Barcelona star let them off the hook.

It was not the first time Naeher had rescued her team from late-game doom. In the 2019 World Cup semifinals, she saved a penalty kick against England to preserve a 2-1 victory.

Such moments are what have helped the Americans stand apart from the rest of the world for so long. (Also, of course, there is the nonstop flow of talent that’s deep enough to field two world-class teams in the same tournament.)

As teams such as the Netherlands and Spain make up ground in the skill department, the United States has clung to intangible advantages.

The psychological edge against Canada in Monday’s semifinal is enormous. The teams are fierce rivals because they clash regularly, the scores are typically close and the players know one another well through NCAA and National Women’s Soccer League circles.

The results, though, are terribly one-sided: 51-3-7 in favor of the United States, including 31-0-5 over the past 20 years.

The Americans will be heavy favorites to advance to the gold-medal match Aug. 6 in Tokyo against Sweden or Australia, both of which were in a first-round group with the United States. The 3-0 defeat to the Swedes and 0-0 draw with the Aussies don’t look quite as bad now.

Nonetheless, Andonovski said Friday, “They are not used to losing; they’re not even used to having a bad game.”

Whether or not they brandish enough to win gold, U.S. changes are coming soon. The victory against the Netherlands put them off a little longer, but with the roster core past its prime, the squad will look different at the 2023 World Cup in Australia and New Zealand. Players such as Catarina Macario, Sophia Smith and Andi Sullivan are waiting in the wings.

Before that happens, though, there is the matter of another golden laurel, two victories from the grasp of a seasoned group that isn’t quite ready to step aside.