Neymar scored two goals, including a controversial penalty, as hosts Brazil made a winning start to their World Cup campaign.
The five-time winners trailed when Marcelo’s own goal, after Nikica Jelavic’s miskick, put Croatia ahead.
But Brazil were level when Neymar equalised from 25 yards following Oscar’s powerful run.
Neymar scored from the spot after Dejan Lovren fouled Fred, before Oscar wrapped up victory in stoppage time.
Croatia will feel hard done by, particularly after the controversial penalty decision by Japanese referee Yuichi Nishimura when Fred threw himself to the ground while backing into Lovren.