CHESTER, Pennsylvania (AP) — Backup goalkeeper Luis Mejia saved two penalties in the shootout as an inspired Panama team ended a trying week with a medal at the Gold Cup, beating the United States in the third-place game Saturday.

Panama won the shootout 3-2 after extra time ended with the score 1-1. Mejia saved DaMarcus Beasley's shot in the fifth round in what might have been the veteran defender's last game for the U.S.

Panama was on the verge of beating Mexico in Wednesday's semifinals despite being down to 10 men but was called for a disputed hand ball in the area. Mexico converted the penalty in stoppage time, then scored on another penalty in extra time for the 2-1 win.

The Panamanian federation's president later alleged the match was fixed, and players were seen arriving at PPL Park in suburban Philadelphia on Saturday wearing T-shirts that read, "Dignity isn't bought."

It was a disappointing Gold Cup for the Americans, who came into the tournament as favorites to repeat as champions after beating Panama in the 2013 final. But they were stunned by Jamaica in the semis and had their worst Gold Cup finish since losing to Colombia during a shootout in the 2000 quarterfinals.

After the U.S. squandered a two-goal lead in a 4-2 loss to Mexico in the 2011 Gold Cup final, Bob Bradley was fired as coach, leading to Jurgen Klinsmann's hire.

U.S. Soccer Federation President Sunil Gulati said there were no parallels between that situation and this year's, however, noting recent friendly victories over Germany and the Netherlands.

"It's obviously a disappointment," Gulati said. "I wouldn't call it a step back."

Panama was missing several key players because of injury or suspension, including its top goalkeeper. But it dominated play against a sluggish U.S. team, with 11 shots on goal to the Americans' two in regulation.

"We really worked for this game," Panama coach Hernan Gomez said, "and we faced the world out there with our heads held high."