Brazil goal-keeper Julio Cesar saved two spot-kicks in a shootout against Chile to send the hosts into the World Cup quarter-finals 3-2 on penalties following a pulsating 1-1 draw after extra time.
Four years to the day since Brazil eliminated Chile at the same stage of the 2010 tournament, they did it again when Gonzalo Jara sent his spot-kick against the post after Cesar had twice denied the battling Chileans.
Five-times champions Brazil will next play the winners of the other last-16 match later on Saturday between Uruguay and Colombia.
David Luiz put Brazil ahead after 18 minutes but Alexis Sanchez equalised for Chile before halftime.
"It was complicated," Cesar said in a television interview. "The pressure of representing Brazil and playing at home is really great. We played well in the first half but after Chile equalised they got into the game."
The Brazilians, who had eliminated their fellow South Americans in three previous World Cups, set a blistering pace from the start and Marcelo took a first crack at Chile with a volley that sailed wide.
They took the lead when Neymar whipped in a corner in the 18th minute, Thiago Silva headed it on and David Luiz, with what looked like some help from Chile's Jara, flicked it in for his first international goal in his 40th appearance.
Chile levelled 14 minutes later after making the most of a throw-in mixup between Hulk and Marcelo to send Alexis into the box and the forward drilling in to stun the crowd into temporary silence.
Neymar, deciding to take matters into his own hands, went agonisingly close with a header that scraped past the post and controlled a superb deep cross-field ball to set up Fred, who fired high.
In the end, it was Cesar who saved Brazil's blushes and broke Chile's hearts.