The United States has failed to qualify for the 2018 World Cup.

The U.S. lost 2-1 to Trinidad and Tobago on Tuesday night while both Panama and Honduras won their games to pass the Americans in the CONCACAF standings.

Panama scored a hugely controversial goal to draw level with Costa Rica before going ahead in the 87th minute to win 2-1 and earn the region's final automatic qualifying spot. Honduras advanced to the intercontinental playoff against Australia by beating Mexico 3-2.

Panama finished in third place in the CONCACAF Hexagonal table with 13 points from 10 games, ahead of Honduras on goal difference, while the U.S. ended with 12.

"We failed on the day. No excuses," said U.S. coach Bruce Arena, who took responsibility for the failure to qualify. "We failed today. We should have walked off this field with at least a point."

Trinidad got on the scoreboard first when Omar Gonzalez deflected a 17th-minute cross that looped over Tim Howard and into the U.S. goal.

It was 2-0 in the 36th minute when Alvin Jones smashed a swerving shot from the right flank past Howard to give the hosts a 2-0 advantage at the break.

Christian Pulisic gave the U.S. the perfect start to the second half, firing home from just outside the penalty area just after kickoff to make it 2-1.

The U.S. frantically chased another goal in the closing minutes, but it never came, which means Arena's team is the first American group since 1986 to not make the World Cup.

Panama fell behind at home against Costa Rica before pulling off a 2-1 win and qualifying for the World Cup for the first time in the country's history -- under stunning circumstances.

Johan Venegas' goal gave Costa Rica -- which secured its own qualification on Friday night -- a lead in the 36th minute.

Panama needed a victory after falling 4-0 to the U.S. on Friday, and they got the result as Gabriel Torres scored in the 52nd minute before Roman Torres became a national hero by scoring the winner three minutes from time.

Replays appeared to show that the equalizing goal never crossed the goal line. The ball came into the box on a corner after it came off of Gabriel Torres' rear end, instead hitting the post and sitting on the goal line, but the referee gave the goal.

With time winding down, Panama's Luis Tejada headed the ball forward into the box, and Roman Torres outraced a Costa Rica defender before poking it past backup goalkeeper Patrick Pemberton.

In Honduras, Oribe Peralta opened the scoring for Mexico in the 17th minute by slotting home a Raul Jimenez assist to put his team up 1-0.

Alberth Ellis pulled Honduras level in the 34th minute, sweeping home at the back post from a set piece, but Mexico would restore its advantage before the break with Carlos Vela scoring after Hector Herrera played him through.

An own goal from Guillermo Ochoa put Honduras back on level terms early in the second half, after a Jimenez strike almost doubled the lead for Mexico, who have long since qualified.

Minutes later, the hosts took the lead through Romell Quioto, who smashed home from a Jorge Claros assist to make it 3-2 in favour of Honduras and send the home crowd into a frenzy that was only slightly dampened by news of Panama's late winner.

Honduras will face Australia in a home-and-home two-legged playoff in November for one of the final places at next summer's World Cup in Russia. The U.S. will be staying home.