Brazil didn't make it look pretty, but they got the job done to advance in the World Cup.
Brazil's goalkeeper, Julio Cesar, saved two spot-kicks in a shootout against Chile to send the hosts into the World Cup quarterfinals 3-2 on penalties following a 1-1 draw after extra time on Saturday.
- Celebrity deaths 2018: All the stars we lost too soon 45 Pictures
- 10 finalists for TIME Person of the Year 2018 11 Pictures
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-time 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 equalized for Chile before halftime.
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.
Chile quickly lost the battle in midfield, but their defense kept tournament joint top scorer Neymar constantly in check.
They were helpless, though, 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.
With the small red patches of Chile fans in the Mineirao stadium swallowed up by a vast sea of yellow shirts, five-times champions Brazil kept pouring forward and Neymar should have done better when he raced clear only to drive a low shot wide.
Chile, however, leveled 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 agonizingly close with a header that scraped past the post and controlled a superb deep cross-field ball to set up Fred, who fired high.
Dani Alves tested Claudio Bravo with a thundering long-range effort but the Chile keeper did well to tip it over the bar.
Brazil, who had won nine of their previous 10 meetings with Chile, thought they had scored again early in the second half when Hulk controlled a deep cross to drill in but referee Howard Webb booked the winger for handball.
At the other end Cesar pulled off a sensational save to deny Charles Aranguiz from point-blank range in a pulsating game where players of both teams resembled tightrope walkers with no safety with one wrong pass proving costly.
Chile, running on empty in extra time, almost snatched a dramatic last-minute winner when Mauricio Pinilla rattled the crossbar with a tremendous shot.
But keeper Cesar saved spot-kicks by Pinilla and Alexis before Jara failed to convert and the stadium erupted in celebration.