Joel Campbell celebrates the third goal scored against goalkeeper Tim Howard during the FIFA 2014 World Cup qualifier at Estadio Nacional in San Jose, Costa Rica. (Kevin C. Cox/Getty Images)

The U.S. men’s national soccer team carried the world’s longest winning streak and the tantalizing, albeit distant, prospects of securing an early World Cup berth into Friday night’s qualifier.

But this is Costa Rica. And the Americans do not win in Costa Rica. Not on the brutal turf of Saprissa Stadium and, on their visit to a new venue, not at National Stadium.

The Ticos scored twice in the first nine minutes to claim a 3-1 victory and overtake the United States for first place in the six-team regional standings. Although the Americans (4-2-1, 13 points) remain on course to earn one of three automatic berths in Brazil next summer, the road became a little more complicated with three matches left.

“We know it’s going down to the wire, it’s going down to the last game,” U.S. Coach Juergen Klinsmann said.

On Tuesday in Columbus, Ohio, they will face bitter rival Mexico (1-1-5, eight points), which is reeling from a 2-1 home loss to Honduras on Friday.

Costa Rica (4-1-2, 14) defeated the United States for the seventh consecutive time in San Jose and improved to 8-0-2 at home in the all-time series. The Ticos also avenged a qualifying loss in snowbound Denver in March — the source of much bitterness then and now.

The Americans, weakened by midfielder Michael Bradley’s late scratch with an injury, answered their poor start with Clint Dempsey’s penalty kick just before halftime and a promising second half. But Joel Campbell’s goal in the 75th minute sealed the outcome and ended the U.S. winning streak at 12.

Seasonal thunderstorms rolled into the Central Valley at midday, threatening, but failing miserably, to dampen the spirits of a city and country. Mata Redonda, the neighborhood housing the two-year-old stadium, bustled with activity as kickoff approached.

Costa Ricans like to think of themselves as the happiest people on earth. And who could blame them? It’s almost paradise. But with the first-place Americans in town and memories of the first frosty meeting lingering, the Ticos were in a feisty and determined mood.

The setting was awesome — a cauldron of sights and sounds to rival the most fanatical soccer stages around the globe.

Klinsmann offered one major twist to the U.S. lineup: Michael Orozco at right back instead of Geoff Cameron or Michael Parkhurst. Orozco had not appeared in a qualifier in almost five years and was regarded as cover at center back.

That was planned. This was not: Bradley sprained an ankle during warmups and Cameron was summoned. Bradley does not offer Landon Donovan’s flash, Jozy Altidore’s menace or Dempsey’s cool. But he is the most important element in Klinsmann’s cause — a poised, two-way player who disrupts and creates.

“It maybe shocked the team a little bit, and when you get 1-0 down after a minute, it makes it even more difficult,” Klinsmann said.

Would his presence have altered the first nine minutes? Maybe. But the Ticos were playing with such speed and confidence, no one was going to impede them.

Just like four years ago, when Costa Rica set the tone with an early goal, the Ticos went ahead in the second minute. Johnny Acosta met Campbell’s corner kick for a header into the near side.

Seven minutes later, Cristian Bolańos served a wonderful ball from the left wing. Celso Borges made a hard run into the penalty area and met Bolańos’s offering in stride to head the ball past Tim Howard.

The crowd reaction might have awakened a dormant volcano. Or given birth to a new one.

The Americans dodged further trouble before the half: Howard made a one-on-one save on Campbell and referee Marco Rodriguez ignored two Costa Rican pleas for penalty kicks.

The match turned just before intermission when, against the tide, Costa Rican goalkeeper Keylor Navas took down Fabian Johnson attempting to connect with Graham Zusi’s quick free kick.

Navas read Dempsey’s penalty kick well, but the shot was struck with such power, it caromed off the keeper and into the net.

The Americans continued to gain traction after the break, seizing possession and serving threatening balls. In the 56th minute, Dempsey’s 20-yard effort nicked the outside of the left post.

With the United States pressing for the equalizer, Campbell latched onto Jose Miguel Cubero’s clearance, outpaced Matt Besler and slipped the ball between Howard’s legs.

Notes: Bradley will be given an MRI exam Saturday in Columbus. His status for Tuesday’s game remains uncertain. . . . Cameron, Besler and Altidore will miss the Mexico game with yellow card suspensionos.