The Americans may be an underdog when they play Portugal on Sunday in Manaus, but that hasn’t stopped them before.

The United States has beaten the Portuguese in the two most recent meetings, and will try to make it three in a row.

“This is a gut-check game, with a lot of history behind it after beating them in the 2002 World Cup,” said former Cosmos goalkeeper Shep Messing, who is an MSG analyst and is serving as an ESPN broadcaster for the World Cup.

“For both the U.S. and Portugal, this is the World Cup.”

The U.S. is 2-2-1 against Portugal, scoring five goals and allowing just as many. But the first three of those games each took place in Portugal, in 1978, 1980 and 1990. The U.S. has improved dramatically since, and that has shown against Portugal, especially when they met in the group stage of the 2002 World Cup.

“We were looking forward to the challenge,” former Team USA member Jeff Agoos told ESPN. “Any good athlete wants to challenge themselves against the best, and Portugal in 2002 were one of the best teams in the world.

“I think we had a quiet confidence. Player for player, they were better than us. We knew that all 23 players were going to battle hard for one another and support one another and that we were there to do something really special. But there was no bravado, no brashness in terms of going into that game.’’

Agoos — who later became the Red Bulls general manager — was the starting centerback on June 5, 2002, in Suwon, South Korea, against fifth-ranked Portugal and its so-called Golden Generation.

That included the reigning FIFA World Player of the Year Luis Figo, who was a high-scoring midfielder who played for Real Madrid and wore No. 7. Sound familiar (hint: Cristiano Ronaldo)?

But against a lineup that included defender Jorge Costa, Rui Costa and Joao Pinto, the U.S. ran out to a 3-0 lead on goals from John O’Brien, Brian McBride and an own goal, then held on to win 3-2.