Neymar scored the only goal as Brazil beat Costa Rica 1-0 in a friendly played in San Jose.
Brazil arrived following a clear victory over fierce rivals Argentina, but, although they got a positive result, Mano Menezes' team played poorly.
The rain and the tough play by the hosts made everything harder for the Brazilians.
Costa Rica had the first chance of the match, but Winston Parks did not finish well, and although they dominated the game, they failed in the final third.
Menezes tried to change matters in the second half and sent Hernanes and Oscar to the pitch to replace Luiz Gustavo and Lucas, looking for more speed in midfield.
But Costa Rica were better at the start of the second half and Michael Barrantes and Parks were close to opening the scoring.
However, it was Brazil who took the lead. Daniel Alves - who had just come off the bench five minutes earlier - climbed on the right and crossed for Fred.
The ball passed the keeper and Neymar showed up in the six-yard box to hit the winner.
The hosts could not respond with any clear-cut chances with only Neymar coming close to scoring, hitting the bar after keeper Keilor Navas saved a header from Fred.
Brazil, who are not playing the South American qualifiers as they will host the 2014 World Cup, will play another friendly on Tuesday, against Mexico.