Defending Copa America champions Brazil defended strongly with 10 men to advance to the semifinals with a 1-0 win against Chile.
Substitute Lucas Paquet scored the only goal of the match only seconds before Gabriel Jesus was sent off early in the second half.
Paquet 's winner to the left corner of Chilean goalkeeper Claudio Bravo in the 46th minute gave Brazil fans some hope that the Selecao would ease into the next stage. But only two minutes later Jesus was sent off after hitting Chile's Eugenio Mena with a flying kick.
Neymar and Brazil coach Tite said after the match that Jesus didn't see Mena and accidentally kicked him as he tried to recover possession in the midfield.
Brazil worked so hard defensively that Chile had fewer shots on goal after Jesus was sent off than during the time he played; two against three.
Defending well is a characteristic of ours, Brazil's Thiago Silva said.
Regardless of what we did today we concede few goals. Ever down to 10 we created clear opportunities. I am very proud of this team, for its fighting spirit.
Paquet came onto the pitch after a tense first half with few opportunities for both sides. He replaced Roberto Firmino.
Brazil didn't stop threatening Chile with Neymar's dribbles and quick counter-attacks. But Chile was much closer to the equalizer; it had an Eduardo Vargas goal disallowed for offside and English-Chilean Ben Brereton hit the bar with a header in the 68th minute.
An exhausted Neymar said after the match that playing with 10 men was a great test for Brazil. He was not close to scoring as in other Copa America matches, but he was key by holding possession.
"Every match we need to get some tests to make us stronger, show we can do it in every circumstance," Neymar said.
We had to stand together. It was very hard to do it.
Chile's Arturo Vidal said his team will leave the tournament with some pride.
We lost to a great team, a favorite which is playing at home, he said.
If we play like we played today, with some more time to work, this team will clearly have its intensity back. We hope to qualify to the World Cup. It will be hard, but we can.
Peru advanced to the semifinal after beating Paraguay on penalties 4-3 after a 3-3 score in regular time, in the most thrilling Copa America match yet.
Brazil and Peru played the latest Copa America final in 2019, with the hosts winning 3-1. Jesus was also sent off in that match at Rio's Maracana Stadium. Monday's encounter will be at the same Nilton Santos Stadium where Brazil beat Chile.
Brazil coach Tite, who was recently fined by South American soccer body CONMEBOL for criticizing the tournament's organization, once more criticized the quality of the Nilton Santos pitch, despite minor improvements made recently.
If I were watching from home I would say this could have been a good match, and look what it is... Ederson had difficulties to take goal kicks," Tite said.
Please, be responsible. I recognize people are trying to improve the pitch, but find a better pitch for us to play.
The Copa America final will be played at the Maracana Stadium on July 10.