Palmeiras successfully defended the Copa Libertadores title after beating Flamengo 2-1 in an all-Brazilian final that went to extra time on Saturday.

The champion opened the scoring at Centenario Stadium in Montevideo through Raphael Veiga early. Flamengo levelled in the second half thanks to Gabriel Barbosa. Substitute Deyverson netted the winner in the first half of extra time.

Palmeiras became the first team in 20 years to win back-to-back titles. Boca Juniors won in 2000 and '01, the first of those titles against Palmeiras in the final prevented the Brazilian side from retaining its first Copa title.

Gabi of Brazil's Flamengo gestures during the Copa Libertadores final soccer match against Brazil's Palmeiras in Montevideo, Uruguay, Saturday, Nov. 27, 2021. (AP PhotoNatacha Pisarenko)

Gabi of Brazil's Flamengo gestures during the Copa Libertadores final soccer match against Brazil's Palmeiras in Montevideo, Uruguay, Saturday, Nov. 27, 2021. (AP PhotoNatacha Pisarenko)

A counterattack started by defender Gustavo Gomez found right back Mayke free and onside thanks to Flamengo defender David Luiz. Mayke's low cross reached Raphael Veiga, and he put it past goalkeeper Diego Alves in the sixth minute.

Flamengo didn't level until the 72nd, courtesy of its its top scorer Gabriel Barbosa. Assisted by Giorgian de Arrascaeta, the man nicknamed Gabigol scored from close range against goalkeeper Weverton, who was not quick enough to block the shot.

Barbosa scored both Flamengo goals in the 2-1 final win against River Plate in its second and last Copa triumph in 2019.

Deyverson of Brazil's Palmeiras celebrates after he scored his side's second goal against Brazil's Flamengo during the Copa Libertadores final soccer match in Montevideo, Uruguay, Saturday, Nov. 27, 2021. (AP PhotoMatilde Campodonico)

Deyverson of Brazil's Palmeiras celebrates after he scored his side's second goal against Brazil's Flamengo during the Copa Libertadores final soccer match in Montevideo, Uruguay, Saturday, Nov. 27, 2021. (AP PhotoMatilde Campodonico)

The 1-1 looked fair at the end of regular time. But it didn't take long for Palmeiras to regain the upper hand.

A slip by Flamengo midfielder Andreas Pereira in the 95th made the difference. Deyverson, who replaced a fatigued Veiga minutes before, carried the ball all by himself and calmly beat goalkeeper Alves.

Deyverson returned to Palmeiras in June after a loan to Alaves, and was in tears after his first goal in this Copa edition.

Gabi of Brazil's Flamengo celebrates scoring his side's opening goal against Brazil's Palmeiras during the Copa Libertadores final soccer match in Montevideo, Uruguay, Saturday, Nov. 27, 2021. (AP PhotoNatacha Pisarenko)

Gabi of Brazil's Flamengo celebrates scoring his side's opening goal against Brazil's Palmeiras during the Copa Libertadores final soccer match in Montevideo, Uruguay, Saturday, Nov. 27, 2021. (AP PhotoNatacha Pisarenko)

Brazil also contributed both finalists this week in the Copa Sudamericana, won by Athletico. This year marked the first time all four finalists of both Copas came from the same country. Palmeiras' success was the eighth since 2010 for a Brazilian club.

More AP soccer: https://apnews.com/hub/soccer and https://twitter.com/AP_Sports