Sandro and Hernanes seal Brazil win in Gabon
The risk was high on a pitch rendered virtually unplayable by a heavy tropical downpour before kick-off and some wild tackling by an aggressive home team.
Capitalising on hesitation in the Gabon defence after goalkeeper Didier Ovono had to push an awkward clearance on to the crossbar, Sandro opened the scoring in the 12th minute by pouncing on the rebound.
Hernanes doubled the lead 10 minutes before half-time with a flying header after Ovono palmed a long-range shot from Jonas straight into the Lazio midfielder's path.
Defender Fabio was fortunate to escape unscathed from a studs-up tackle in the first half but did not appear again after the interval. His replacement Alex Sandro was the victim of a two-footed lunge that brought strong protests from the Brazilian players.
Puddles on the newly-laid pitch made playing difficult and the start of the match was delayed by almost 20 minutes after the lights at the new stadium went out twice before kick-off.
The Sino-Gabonese Friendship Stadium in Libreville will host February's African Nations Cup final. Gabon are co-hosting tournament with Equatorial Guinea.
Brazil were returning to Africa for the first time since elimination at the quarter-final stage of last year's World Cup. They next play African champions Egypt in Doha, Qatar on Monday.