It might be another 38 years before the U.S. men’s national team returns to Atlanta after Wednesday’s result in the semifinals of the Gold Cup at the Georgia Dome.

Playing in Atlanta for the first time since 1977, the U.S. played some very good soccer, but was upset by Jamaica 2-1 on set-piece goals in the first half by Darren Mattocks and Giles Barnes, whose free kick was the result of one of soccer’s rare calls: a handball against the goalkeeper. Michael Bradley scored for the U.S. in the opening minutes of the second half, but it wasn’t enough.

A new record for soccer in the city of 70,511 tickets were sold to watch what some soccer journalists said is the worse U.S. upset loss ever. It was also the United State’s first loss in the Gold Cup on home soil to a team from the Caribbean since 1969.

“The team is disappointed, the fans are disappointed because you wanted to play in the finals in Philadelphia,” U.S. manager Jurgen Klinsmann said.

The loss ends the United States’ hopes of defending its title and winning its sixth Gold Cup. Mexico defeated Panama 2-1 in the second semifinal Wednesday night, helped by a game-tying controversial penalty kick in the final minutes of regulation.

Jamaica, 42 spots below the U.S. in FIFA’s world rankings, will make its first appearance, and the first for a team from the Caribbean, in the championship game Sunday in Philadelphia. The U.S. will meet the loser of the second semifinal in the third-place game Saturday in Chester, Pa.

“What we did today was over the limit,” Jamaica manager Winfried Schafer said. “I’m very happy for this.”

The loss also denied the U.S. an opportunity to clinch a place in the 2017 Confederations Cup, a tournament that Klinsmann stressed the importance of in his pregame remarks Tuesday. Instead, the U.S. will play the winner of the Gold Cup for the right to go to the Confederations Cup.

The U.S. was left to rue not converting numerous corner kicks and free kicks — some of them created by nervous Jamaican goalkeeper Ryan Thompson — throughout the game. The U.S. outshot Jamaica 20-8 (10-3 on goal) and enjoyed a 16-percent margin in possession.

“We had enough chances to put three, four, five in there,” Klinsmann said. “But we didn’t do that. It’s unfortunate, but it’s reality.”

Jamaica took the lead when Mattocks stepped in front of John Brooks and flicked a header over goalkeeper Brad Guzan. The ball hit one post, rolled all the way across the goal and hit the opposite post before trickling in in the 30th minute. The header came from a perfectly placed throw by Kemar Lawrence to the center of the penalty box.

Jamaica quickly doubled its lead to 2-0 on a rocket of a free kick by Barnes from just outside the penalty box in the 35th minute. His right-footed shot curled over the wall and into the corner of Guzan’s goal. The kick was awarded because Guzan’s arm extended past the penalty box as he threw the ball up the field. It’s a call that is not often made in the sport. Barnes said he didn’t know what had happened until he saw the replay.

“The feeling right now is insane,” said Barnes, who plays for Houston in MLS. “We’ve come here and defeated a great side with a great manager.”

The U.S. had work to do considering Jamaica had allowed two goals in a game once in the tournament, and those came in its opening game against Costa Rica. It hadn’t allowed any goals in three games since.

But it didn’t take the U.S. long to respond.

Aron Johannsson turned at the top of the box and hit a shot right at Thompson, who couldn’t hold onto the ball as Clint Dempsey rushed in to apply pressure. The ball bounced to Bradley, who poked it into the goal in the 47th minute.

The U.S. continued to apply pressure, but couldn’t find the tying goal against a disciplined and compact Jamaica defense.

“We had enough chances to put this game away,” Klinsmann said. “The luck was not with us maybe, but also we weren’t clinical enough to put it in there. It’s the goals that matter.”