Fred scored the only goal of the game as Brazil recorded a narrow 1-0 victory over Serbia in their final friendly before their World Cup campaign begins against Croatia.
The hosts almost went behind in the fourth minute, but David Luiz's glancing header from Dusan Tadic's free kick flew narrowly over his own crossbar.
Aleksandar Kolarov then struck a fierce shot into the side-netting as Serbia continued to threaten, and the Manchester City left-back almost forced Luiz into another error with a drilled cross soon after.
As the game approached the half-hour mark, Aleksandar Mitrovic directed a free header wide of goal, which led the home crowd to grow increasingly frustrated with their side's disjointed performance.
Serbia thought they had taken the lead in the 44th minute when Lazar Markovic forced the ball home from close range, but the forward was in an offside position.
Brazil were booed off as the half-time whistle sounded, but Luis Felipe Scolari resisted the urge to make any substitutions at the break.
In the 58th minute, the Selecao finally gave their fans something to cheer when Fred put them 1-0 ahead. The forward brought down a Thiago Silva cross, and despite losing his footing, the 30-year-old kept his composure to slot the ball beyond Vladimir Stojkovic.
Kolarov continued to cause problems for the hosts, and his 73rd-minute cross found Bojan Jokic, who crashed a header against the outside of the post.
Hulk then wrongly had a second Brazilian goal ruled out for offside, which led to a nervous final quarter of an hour for the home side, but they held on to record a win in their final World Cup warm-up match.