BELO HORIZONTE, Brazil — Brazil advanced to the World Cup quarterfinals Saturday with a 3-2 shootout win over Chile following a tense and thrilling battle that ended 1-1 after extra time.

Neymar, David Luiz and Marcelo scored in the shootout, and Brazil goalkeeper Julio Cesar saved two penalties before watching Gonzalo Jara’s final attempt hit the post.

“My teammates are giving me a lot of strength on the field so I give my best,” Cesar said. “We’re just three steps away and I hope to give another interview with Brazil partying.”

Brazil, which extended its 39-year unbeaten streak in home competitive matches to 61, will next face Colombia in the quarterfinals.

Neither team managed to score at the Mineirao Stadium after first-half goals from Luiz and Sanchez, but Brazil came close to an early exit when Mauricio Pinilla’s shot hit the crossbar in the final moments of extra time.

Chile also had the best chance in the second half, when Cesar’s spectacular save on Charles Aranguiz’s shot kept the score even.

Brazil has reached the quarterfinals of each World Cup since a second-round loss to Argentina in 1990. Getting knocked out at that stage in its own World Cup would have been a disaster.

But the Brazilians overcame their nerves in the shootout, with Neymar scoring the final penalty after Cesar stopped spot kicks from Pinilla and Sanchez.

When Jara hit the post, some of Brazil’s players celebrated wildly while others fell to the ground, exhausted and emotionally drained. Willian, who missed a penalty for Brazil, sobbed uncontrollably, as Fred helped him to his feet.

As the crowd roared, the Brazilian players joined hands in a human chain.

The Chileans stood still, staring into the ground, wiping the sweat off their faces.

“We tried to give everything, we tried to fight for a dream, and we didn’t achieve it,” Chile midfielder Arturo Vidal said. “But we gave all our effort on the pitch.”

“Do you think I can be satisfied with the result?” Sampaoli said. “We’ve played a hard 120 minutes even if everybody was against us in the stadium.”

Brazil will face Colombia in a quarterfinal on Friday.

COLOMBIA 2, URUGUAY 0: James Rodriguez scored twice to put Colombia into the World Cup quarterfinals for the first time.

Rodriguez gave his team the lead with a stunning long-range volley on the turn in the 28th minute and added the second from close range shortly after the break as Colombia dominated a Uruguay side that sorely missed banned striker Luis Suarez.

Rodriguez now has a tournament-leading five goals and further enhanced his status as perhaps the tournament’s biggest revelation.

Uruguay, meanwhile, struggled badly in attack without Suarez and his replacement Diego Forlan was substituted in the 53rd after a disappointing performance in what was probably his final World Cup appearance.