No one gave Costa Rica much of a chance at the World Cup in 1990. Not Scotland. Not the Costa Rican people. At one point, not even the Costa Rican players themselves. Their head coach in Italy, the Yugoslav Bora Milutinovic, had been playing mind games with his players.

“Bora had the experience from coaching Mexico in the World Cup, and he was like a father who knew about what we would have to go through,” says attacking midfielder Juan Cayasso. “For him, we were playing so bad. I thought he thought we had not much chance before going to the World Cup. But he always kept so cool. And once we got there, I think he got a little bit more faith about what could happen. He was very important for us in terms of our mentality.”

But even Milutinovic could not have expected what came next. The Ticos humiliated Scotland in the Genoa heat, winning 1-0.

They followed that by losing 1-0 to Brazil when people back home had expected a cricket score. And they weren’t finished there.

The Ticos then took out Sweden 2-1, qualifying for the last 16. They sent their tiny country, sandwiched between Panama and Nicaragua, into rapture. The least-fancied team at the tournament had put themselves on the football map.

Cayasso was the man who got the ball rolling on Costa Rica’s incredible journey nearly 28 years ago. It was the 49th minute of their opening Group C game with Scotland, and suddenly he found himself presented with a golden opportunity. The Costa Rican striker, Claudio Jara, had produced a stunning back-heel at the edge of the box to put the 28-year-old midfielder one-on-one with Scotland goalkeeper Jim Leighton.

“I don’t know if I remember it because I always see it on video people play,” recalls Cayasso, speaking from his office in Limon on Costa Rica’s lush Caribbean coast where he directs grassroots sport. “But I could never be prepared for that moment. My teammate Claudio Jara, knocked the ball to me – we call it a taquito here. I was close to him, I step back and when he does the taquito I read it. At first, I’m like, ‘Oh…’ I’m frightened. But then I have to react, it’s at my foot, Jimmy is out. Then it hits his belly and goes over him. I turn around and look at the referee, and he’s going to the centre of the field. First I’m frightened, then I don’t believe it, then, ‘Yes, goal.’ I had gone faraway in that moment. My mind was all about Costa Rica.”

Up to that point, the only nations from Central America who had

qualified for a World Cup were El Salvador (in 1970 and 1982) and Honduras (1982). Mexico were the domineering force of the wider Concacaf region.

Fast forward to today, and Costa Rica are the undisputed third force of the entire North American continent behind Mexico and the United States – and, as this year indicates, sometimes more. In Brazil, they were one of the stories of the 2014 World Cup as they reached the quarter-finals. In Russia, they will form part of a Concacaf trinity who qualified alongside Mexico and Panama, with the United States missing out. Cayasso says the progression started with his generation of players.

“We had some very important things happen,” he says. “We had a lot of friendly games against European teams. We qualified to the Olympic Games in Moscow [1980} and then the Los Angeles [1984] Games. That generation of players went to those, getting a lot of experience.

“In 1990, Alajuelense and Saprissa [Costa Rica’s biggest club sides] had Czech trainers, European trainers. So we had that European mentality to play the way they play because the football in Costa Rica was so slow. It was the right moment.”

As part of their preparations to play Scotland, the Ticos had played a friendly against Wales in Cardiff. Losing 1-0, they nevertheless used the exercise to adapt to a more British-style opponent. By this point, Scotland had identified Costa Rican goalkeeper Luis Gabelo Conejo as a potential weakness. The folly of this scouting report played out disastrously as Conejo put in an outstanding performance. But, as Cayasso admits, Scotland manager Andy Roxburgh and his staff were not wrong in their analysis.

“It’s true, when Gabelo was in Costa Rica, he played with a very small team, always losing by three, four or five. It was so bad. That’s why I think it was a miracle: Gabelo was the best one of us,” he says.

“I wrote a book called The Goal from Italia 90: Destiny, Luck or Chance. It was so crazy. We planned so many things against Scotland, to play the tactical way, on the outside, but no one went on the outside. We see Gabelo coming out and holding high balls against big players. I don’t know how they didn’t score against us. Gabelo was incredible but that wasn’t so normal.”

It was only years later Cayasso learned of the humiliation that followed for the Scotland team. He is almost apologetic for his part in the outcome. He then stifles laughter when asked whether the result gave Costa Rica confidence they might be able to

qualify after all.

“In the place where we were staying I was sitting in the corner thinking about what had just happened,” he says. “We had beaten Scotland and I was thinking was this true or not? I was in shock. Thinking about qualifying? No, no one was thinking that. We got confidence. Things came out good against Brazil and then we started thinking we have a chance. Scotland won 2-1 against Sweden, which was good for us because we beat Scotland.”

With Sweden dispatched, it was on to a last-16 match against Czechoslovakia. The squad, made up entirely of players who played in Costa Rica’s semi-professional domestic league, had been gone two months. Some had days jobs as taxi drivers and were manual labourers. Ticos are a tight-knit family-oriented people. Some players were feeling the effects, says Cayasso.

“Some of us were like, ‘we qualified, we can go home now.’ And some of us were like, ‘No, we can stay more. We can win against Czechoslovakia. Then it’s [West] Germany in the next game.’ The mind of the team was out of synch.”

The incredible journey was to end with a disappointing 4-1 defeat and just like that, Costa Rica were on a plane home. On landing, Cayasso and the rest of the squad were presented with new Toyota Corolla cars by the country’s president. These were luxury items for many of the players. Cayasso still has his. Fellow midfielder German Chavarria turned his into a taxi. To this day members of the squad can’t walk the streets without being stopped by well-wishers.

On a personal level, Cayasso’s performances won him a move to Germany with Stuttgarter Kickers. The first Tico in 32 years to play outside the country at such a level, he went on to help them gain promotion to the Bundesliga. Others, like miracle goalkeeper Conejo, followed.

This summer Cayasso will mark his 57th birthday during another World Cup in which Costa Rica is represented, this time with far more respect.

As for Friday’s friendly re-match with Scotland, he doesn’t see a win for his country, sensing a draw. But this time round, the Costa Rican people won’t lack the faith they did in 1990. And few Scots will write off the Ticos as easily as they did nearly three decades ago, especially new manager Alex McLeish, who was in that team who lost in Italy.

Two members of Costa Rica’s 1990 team will also be present in the away dugout: head coach Oscar Ramirez, who played in midfield, and Conejo, now Costa Rica’s goalkeeper coach.

Cayasso would love to visit the country he humbled. Laughing, he adds: “But maybe it’s too dangerous for me to go there.”