Peru advanced after beating Paraguay 4-3 on penalties after a 3-3 draw.
Brazil and Peru will now meet in a repeat of the 2019 final, which the former won 3-1.
Peru came through an action-packed game against Paraguay, who took the lead through captain Gustavo Gomez early on.
However, two goals from Gianluca Lapadula put Peru in front and, despite Paraguay having Gomez dismissed just before half-time, they equalised through Junior Alonso.
Yoshimar Yotun restored Peru’s lead but, after they went down to 10 men when Andre Carillo was sent off in the 84th minute, Gabriel Avalos scored a last-minute leveler to send the tie to penalties.
Paraguay missed with three of their spot-kicks before Miguel Trauco scored the decisive penalty for Peru.