CARSON, Calif. — Although Australia wrapped up the inaugural Tournament of Nations title before the U.S. women stepped on the field, Megan Rapinoe and her teammates still finished strong.

Rapinoe scored a splendid goal in the 12th minute, and the Americans beat Japan 3-0 on Thursday night in the final match of the four-team round robin event.

//platform.twitter.com/widgets.js

Mallory Pugh and Alex Morgan scored in the second half as the U.S. entertained a crowd of 23,161 that didn’t seem to mind finishing second in this friendly tournament.

Australia rendered the Americans’ final result irrelevant to the standings by routing Brazil 6-1 in the early game at StubHub Center south of downtown Los Angeles. The U.S. needed Australia to lose to have any chance to make up a three-goal aggregate deficit.

“You look at Australia, and they’re a seasoned team because they’ve been together so long,” U.S. coach Jill Ellis said. “That’s the next step for us, is working on our chemistry and our team play.”

The top-ranked Americans’ 1-0 loss to the Matildas in Portland last week turned out to be the decisive match in the Tournament of Nations, which was created to give more opportunities to the U.S. team to face top opposition. Ellis used the tournament to give minutes to underused players and to work on new lineup combinations, such as playing Becky Sauerbrunn and Abby Dahlkemper together on the back line.

After getting shut out in the opener, the Americans also showcased their wealth of strong attacking players with seven goals in the final two tournament games against two of the world’s top eight teams. The U.S. followed up its incredible late comeback against Brazil last Sunday with a solid performance against Japan in a rematch of the 2015 World Cup final.

“Now it’s about building connections,” Ellis said. “I know what I’ve put the players through in terms of it being challenging. … It’s not going to be chemistry right now. It’s when they come out of this and they start to build relationships.”

The U.S. improved to 27-1-7 against Japan.

Rapinoe’s goal was a stunner: She took a clever pass from Christen Press in stride and stutter-stepped her way through the penalty area, dropping defender Aya Sameshima to the turf with a fake before firing a low shot past goalkeeper Ayaka Yamashita.

The goal was Rapinoe’s 33rd for the U.S., capping a tournament in which she was easily the best American.

Japan pressed the attack for much of the first half, but U.S. goalkeeper Alyssa Naeher made a diving stop to keep the lead. Midfielder Julie Ertz also cleared a ball off the goal line in the 34th minute and then crashed into the post.

The Americans scored again in the 60th minute after Taylor Smith pounced on a giveaway and fed a pass to the speedy Pugh. The 19-year-old ex-UCLA star walked in on Yamashita for her fifth career goal and her first of the year.

Morgan then chipped a close-range shot off a sliding Japanese defender in the 80th minute.

“We have a lot of really active players up front, so I was very pleased with our depth there,” Ellis said.

The U.S. women return to action next month with friendlies against New Zealand in Commerce City, Colorado, and in Cincinnati.