PARIS >> Mallory Swanson says Trinity Rodman gave the United States a bit of magic when the team needed it most.

Rodman scored in extra time and the United States advanced to the women’s soccer semifinals at the Paris Olympics with a 1-0 victory over Japan on Saturday.

“Ultimately in games like this, sometimes it just takes a little bit of magic, and little bit of individual brilliance, and that’s what Trin did,” Swanson said.

The United States will face the winner of the later match between Germany and defending champion Canada in Marseille on Tuesday. The U.S. beat Germany 4-1 in the group stage.

The U.S. is guaranteed two more matches in France: Get through the semis with a win and it’s on to the gold medal match; lose and there’s still the bronze up for grabs.

The U.S. went into the knockout match undefeated and outscoring opponents 9-2 at the Paris Games under new coach Emma Hayes, but Japan foiled the Americans with steady defense.

Rodman’s goal to the top of the far post came as time in stoppage time in the first extra period. She fell to the field as she was embraced by her teammates in celebration.

“I kind of blacked out,” Rodman said with a laugh when asked to describe the goal. “That’s like the best moment in my career.”

It was Rodman’s third goal of the tournament. She nearly scored again in the second extra period.

“I keep saying this but we want to just keep improving and I think that’s what we’re doing,” she said. “Being around so many players and staff that want to improve every single day is helping me be my best self and my most confident self.”

Afterward, several of the Japanese players collapsed on the field in tears. U.S. captain Lindsey Horan embraced Riko Ueki.

Former U.S. women’s national team stars Megan Rapinoe and Mia Hamm, as well as rapper Snoop Dogg, were among the fans at a packed Parc des Princes.

Rapinoe and Hamm celebrated wildly together in the stands along with U.S. Soccer president Cindy Parlow Cone when Rodman scored.

“It’s not always flashy,” Hayes said about the tense match. “It’s not always what fans want to see, but this is football, and football requires different tactical abilities from game to game. We played the right game for the right opponent.”

Hayes, the former boss at Chelsea, was hired last fall to lead the Americans after they struggled at last summer’s Women’s World Cup and were eliminated from the tournament earlier than ever before.