The 71st-minute penalty from Neymar that tipped the Group A game Brazil's way seemed a soft one after Japanese referee Yuichi Nishimura harshly ruled that Croatia captain Dejan Lovren had fouled Fred. The striker threw himself to the ground.
Neymar had brought Brazil back into the game after 29 minutes with the equaliser after defender Marcelo put the ball into his own net after 11 minutes to give Croatia a shock lead.
Marcelo's misfortune meant he became the first Brazilian ever to score an own goal at the World Cup.
The cross came from Ivica Olic whose low ball from the left went through the legs of Brazil captain Thiago Silva, clipped Nikica Jelavic's foot and bounced in off Marcelo with goalkeeper Julio Cesar helpless. Neymar created Brazil's first opening when he jinked along the byeline, resulting in a half-cleared ball to Oscar who slammed in a curling 25-yard drive that goalkeeper Stipe Pletikosa acrobatically pushed away.
Croatia's reprieve only lasted seven minutes and the equaliser was greeted by scenes of unbridled joy.
Oscar started the move by beating two men in midfield before finding Neymar, who advanced a few metres before cracking in a low left-foot shot that went in off the base of Pletikosa's left-hand post for his 32nd goal in his 50th international.
He scored his 33rd when Pletikosa got both hands to his penalty but could not divert the ball round the post. Oscar wrapped up the win late on, the playmaker bursting through to toe-poke home to put things beyond any doubt.