Randall Azofeifa, Bryan Ruiz, Sporting Lisbon's Campbell and an own goal by Russia's skipper Vasily Berezutsky gave Costa Rica he win.
Joel Campbell's injury-time spotkick lifted Costa Rica to a 4-3 win over Russia on Sunday to end the 2018 World Cup hosts' unbeaten run under new coach Stanislav Cherchesov.
Goals by midfielders Randall Azofeifa, Bryan Ruiz and Sporting Lisbon's Campbell and an own goal by Russia's skipper Vasily Berezutsky set Costa Rica on their way to success in the friendly at the newly-built Krasnodar Arena.
Artem Dzyuba, who netted a double, and Alexander Samedov were on target for Russia.
"It's an excellent result against an opponent like Russia," Costa Rica manager Oscar Ramirez said.
"We played better in the first half while Russia performed really well in the first 15 minutes after the break.
"The draw would have been the fairest result but we were awarded a penalty and scored the fourth goal at the death."
Spurred on by a capacity 33,700 crowd Russia started brightly, Costa Rica's Real Madrid 'keeper Keylor Navas forced into a diving save in the third minute by Samedov's close-range shot.
In the 22nd minute Azofeifa beat Russian keeper Soslan Dzhanaev with a powerful shot from the edge of the area.
Skipper Ruiz made it 2-0 seven minutes later when he fired the ball into the far left post from 25 yards out.
Samedov pulled one back with a header from the edge of the six-yard area in the 31st minute but in first half stoppage time Berezutsky sent the ball into his own net trying to clear a cross by Johnny Acosta.
After the interval Dzyuba scored twice in the space of 13 minutes to pull Russia back level at 3-3.
But second-half substitute Campbell scored the decisive goal from the spot in injury time after Berezutsky felled him in the area.
"We still have plenty of work to do," Cherchesov, who took over in August, said.
"I'm really pleased with the team's comeback but today my players made too many costly individual errors."