TOKYO — Stina Blackstenius scored a pair of goals to help Sweden stun the United States with a 3-0 victory Wednesday in the teams’ opening game of the Olympic women’s soccer tournament.

The Americans, ranked No. 1 in the world and the favorites to win gold in Tokyo, were riding a 44-match unbeaten streak heading into the match. But Sweden, ranked No. 5, has been the U.S. team’s nemesis of sorts in recent years. The Swedes bounced the Americans from the 2016 Rio de Janeiro Games in the quarterfinals, the earliest U.S. Olympic exit ever.

This April, Sweden played the United States to a 1-1 draw in Stockholm to snap the Americans’ winning streak that dated back to January 2019 when they lost to France in the run-up to the World Cup. It was the U.S. team’s only draw this year.

“Did we expect this result tonight? No,” said U.S. forward Megan Rapinoe, who did not start but came on as a substitute in the 64th minute with the score 2-0. “It’s frustrating, and it’s frustrating that it’s Sweden. They found a lot of space on us. I don’t even know how many goals we have given up this whole year. I don’t remember the last time we gave up a goal. So to give up three is not great.”

Sweden’s offense deserved all the credit. Blackstenius’ header into the far corner off a cross from Sofia Jakobsson in the 26th minute gave her team a first-half lead.

The United States, which came out stale, had its best chance of the opening half in the final moments when Rose Lavelle’s shot hit the post. U.S. coach Vlatko Andonovski made changes for the second half, subbing in Carli Lloyd for Alex Morgan, and Julie Ertz for Sam Mewis.

But Blackstenius scored again in the 54th minute, beating goalkeeper Alyssa Naeher as the Americans continued to struggle. Lina Hurtig added the final goal in the 72nd.

Sweden goalkeeper Hedvig Lindahl said the win over the favorites was encouraging, but it’s still just the beginning of the tournament. Ahead for both squads are group games against Australia and New Zealand.

“I know for a fact that you can go very far in a tournament even if you lose to the USA or whoever you play in the first game,” Lindahl said. “So in the end, I don’t know how much it means. But for sure, we showed the world and ourselves that we can play well against a team like the U.S. or any team.”

The loss was the first for the United States under Andonovski, who took over when former coach Jill Ellis stepped down following the team’s World Cup victory in France. Late in the match Wednesday, Andonovski sat expressionless on the bench.

The Swedes were without Magda Eriksson because of injury. The team said she has been training but was held out of the opener because of the compact schedule of the tournament.

The Tokyo Games are the seventh Olympics for Sweden, which claimed the silver medal five years go.

The United States has been to all seven Olympics that have included women’s soccer, too, winning four Olympic gold medals, more than any other nation. The team is vying to become the first to win Olympic gold following a World Cup title.

In 2008, the United States also lost its first match, 2-0 to Norway, but went on to win the gold medal.

“I think ultimately as an athlete, you go through ups and downs. This is a hard result, but it’s the nature of a tough tournament,” U.S. forward Christen Press said. “It wasn’t going to be easy. We weren’t going to breeze through six games no matter what. So here we are.”

It was just the sixth time the United States lost by three or more goals.

Sweden now leads Group G heading into a game against Australia on Saturday, when the United States faces New Zealand. The top two teams in the group advance to the knockout round.

“It is what it is,” Rapinoe said. “We got bopped, and we have two more games coming quick and fast. Now we know exactly what we need to do. We need to win these games and eventually get out of the group and go from there.”