A young U.S. men’s national soccer team was put to the test Sunday night in the Concacaf Gold Cup in Arlington, Tex., and with anxiety levels rising and extra time looming, 20-year-old Matthew Hoppe sent the Americans to the semifinals with his first international goal.

His 83rd-minute header provided a 1-0 victory over Jamaica and set up a Thursday meeting in Austin against Qatar, a guest in the regional championship.

In the other semifinal, Canada — a 2-0 winner over Costa Rica in Sunday’s first game — will face defending champion Mexico on Thursday in Houston. Qatar and Mexico won their quarterfinal matches Saturday in Glendale, Ariz.

“The guys were resilient,” U.S. Coach Gregg Berhalter said. “They just kept going. They were relentless in the way they played.”

Substitute Cristian Roldan set up Hoppe’s winner with a cross from the right flank to the back side. Jamaican goalkeeper Andre Blake came off his line too late and couldn’t reach the flighted ball. Hoppe, a German-based forward making his third U.S. appearance, and teammate Gyasi Zardes rose in the six-yard box, and Hoppe nodded it in.

With time melting away in regulation, midfielder Sebastian Lletget said, “you get a little bit more nervous and you just try to be composed. It’s a young group and we’ve never really been in this situation before, but what better way to learn than to just dive into it?”

The Americans, who have conceded one goal in four tournament matches, will appear in the semifinals for the 11th consecutive time. They improved to 14-1-1 since the fall of 2019.

Berhalter received critical performances from goalkeeper Matt Turner and defensive midfielder Kellyn Acosta.

Berhalter called Acosta “a beast,” while Lletget said he was “an animal in there.”

Sunday’s match was a familiar Gold Cup clash: The United States and Jamaica met in the knockout stage for the fourth consecutive time. The Reggae Boyz won a 2015 semifinal, and the Americans prevailed in the 2017 final and 2019 semis.

The Americans were a slight favorite Sunday, but with a lineup averaging just under 24 years and 12 international appearances, plus the absence of injured defender Walker Zimmerman, they were braced for a tight, difficult match.

Berhalter did not call up his top European-based players, opting instead to allow them to reintegrate with their clubs and work on their form before 2022 World Cup qualifying begins in September. That decision also provided a competitive international forum for secondary players to show their value ahead of the qualifiers.

D.C. United’s Paul Arriola started for the first time since he left the group opener with hamstring tightness and wore the captain’s armband. On the front line, he was joined by Hoppe and Daryl Dike, the former University of Virginia star whose availability was in some question after he hurt a shoulder in the group finale against Canada.

With Zimmerman out, Berhalter paired James Sands (fourth cap) with Miles Robinson (seventh) in central defense. All but three starters had made fewer than 10 senior appearances.

Seconds into the match, the Americans were sloppy in the back, rescued by an offside call deep in the box. Both sides generated half-chances in the first 20 minutes before Hoppe tested Blake with a wicked, 10-yard strike targeting the near corner.

As the half unfolded, Jamaica applied pressure on the Americans, who found themselves in tense moments deep in their end. In the 39th minute, Turner matched Blake’s heroics with a full-extension, left-hand save on Junior Flemmings’s 23-yard effort.

Rarely tested in the group stage, Turner was forced to make four saves in the first half.

Hoppe remained a threat after intermission, much more so than Dike, who struggled to find the game and wasn’t tidy with his touches. His teammates failed to find him the ball regularly as well.

Robinson made a critical tackle on Flemmings in the box in the 56th minute, disrupting a swift Jamaican buildup at the last minute.

Berhalter was patient with his starters until the 63rd minute, when he replaced Dike and Arriola with Zardes and Roldan. Zardes got involved right away, smashing a one-timer that Blake parried away, and the Americans enjoyed a dominant spell of possession.

True scoring opportunities, however, were elusive.

Jamaica had a wonderful chance in the 78th minute, but substitute Shamar Nicholson failed in the six-yard box to get a touch on a free kick.

Berhalter was about to replace Hoppe with Nicholas Gioacchini when the Southern California native scored.

“He had a couple clear looks at goal and that’s due to his movement in the box,” Berhalter said. “And he was grinding. When a guy puts that type of effort in and hangs in there and keeps going, we wanted to stick with him because we thought he was doing a good job and because he is goal-dangerous. It was great to see him score.”

Note: U.S. defender Donovan Pines (D.C. United) was not in uniform because of an undisclosed injury. ... Arriola, the leader among the starters with 37 caps, captained the squad for the first time.

CANADA 2, COSTA RICA 0: Stephen Eustáquio assisted on Junior Hoilett’s goal in the first half and scored in the second as the Canadians advanced to the semifinals for the first time since 2007.

In the 18th minute, Eustáquio’s long ball launched Hoilett for a breakaway and chip over advancing goalkeeper Esteban Alvarado. In the 68th, Eustáquio took advantage of a deflection in the penalty area as Canada improved to 9-1-0 in its past 10 matches.

Costa Rica has failed to reach the semifinals in five of its past six attempts.

More from The Post: