David Silva and David Villa scored in the last seven minutes, the equaliser coming in stoppage-time, after they had been outclassed by their opponents in the first half.
"Spain avoid ridicule in Costa Rica" Spanish daily El Pais said on Wednesday, while the front page of sports daily Marca had a message for coach Vicente del Bosque: "Vicente, we have a problem."
Coming hot on the heels of a 1-0 friendly defeat against England at Wembley on Saturday, the latest break for internationals has had a sobering effect on Spain's hopes of becoming the first side to retain the European crown.
"When I said before the match Costa Rica were good I wasn't just saying it to be nice," Del Bosque told reporters.
"In the first half they were better than us, quicker and more aggressive. It was nothing more than that. We aren't guilty of anything. The team showed character to react even if it was at the end."
Captain and goalkeeper Iker Casillas, who broke Spain's record for appearances with his 127th cap, gifted Costa Rica an opener with an uncharacteristic error and they were 2-0 down by the break.
"When things don't go well we are the first people to get annoyed," Andres Iniesta, the scorer of Spain's winner in last year's World Cup final, told reporters.
"We didn't play well in the first half but we have to take note of the team's reaction which was positive. I hope we learn from this."
Spain won all eight games in qualifying for Euro 2012 but have had a patchy record in friendlies since winning the World Cup - losing four, drawing two and winning four.
"We know [Euro 2012] will be difficult and that the rivals will be tough," Del Bosque added.
"Being champions doesn't mean everything is already done. We have plenty of time to think about it and make plans."
Get the best features, fun and footballing frolics straight to your inbox every week.
Thank you for signing up to Four Four Two. You will receive a verification email shortly.
There was a problem. Please refresh the page and try again.