ST. PETERSBURG, Russia -- Costa Rica was the biggest surprise of the 2014 World Cup, a nation of around 5 million people and with little soccer history reaching the quarterfinals and not even losing a game.

Four years later, Los Ticos reverted to their previous form.

After two straight losses - the second coming against Brazil 2-0 on Friday - they already know they will be heading home at the end of the group stage, just like they did in 2002 and '06. Their fans were colorful and passionate, but the team will not be especially missed.

“I think that we have done our best considering our skills,” Costa Rica coach Oscar Ramirez said in a sombre tone.

Costa Rica used the same tactics as it did in 2014, defending compactly with five men at the back and hitting opponents on the counterattack. It worked beautifully in Brazil, allowing the team to top a difficult group containing Uruguay, Italy and England, get past Greece in the last 16, and then take the Netherlands to a penalty shootout.

But a team largely made up the same players couldn't repeat those feats in Russia. They posed Serbia few problems in a 1-0 loss on Sunday and then saw a feisty and obdurate defensive effort against Brazil come undone by injury-time goals from Philippe Coutinho and Neymar.

“Unfortunately we have not played like we did in 2014,” Ramirez said, “and I think the main thing is that we were not able to finish our opportunities.”

It remains to be seen what the future holds for Ramirez, who took charge in 2015 after Paulo Wanchope - the successor to Jorge Luis Pinto, the 2014 World Cup coach - was fired.

But the team needs the next generation to step up if it is to maintain an impressive recent record of qualifying for four of the last five World Cups.

Some of the stalwarts of the Costa Rica team are in their 30s - Bryan Ruiz (32), Johnny Acosta (34) and Cristian Bolanos (33) - and its best attacker, Joel Campbell, has struggled because of a combination of injuries and a lack of stability in his career after going on numerous loans from English club Arsenal.

Campbell was a second-half substitute against Serbia and didn't come off the bench against Brazil.

Ramirez said the difference in the strength in depth between the two sides was the difference on Friday, with substitutes Roberto Firmino and Douglas Costa setting up the two late goals.

“Once Tite made those changes, it was difficult for us,” Ramirez said. “He has substitutes who have amazing skills, and we had substitutes who had as many skills as their teammates but just were not as tired.”

Costa Rica was the fifth team eliminated from the tournament, after Egypt, Saudi Arabia, Morocco and Peru.

Its final game is Wednesday against Switzerland.