River Plate claimed their fourth Copa Libertadores title, 5-3 on aggregate, after defeating Argentine rivals Boca Juniors in 3-1 in a pulsating second leg at the Bernabeu that went to extra time on Sunday.

In a match that was postponed and ultimately moved to Madrid thanks to fan violence outside River's Monumental Stadium, goals from Dario Benedetto and Lucas Pratto pushed the game to extra time, where Juan Quintero's sensational strike from distance and a late Gonzalo Martinez tally gave River a famous victory over their eternal rivals in the biggest edition yet of their Superclasico series.

Benedetto put Boca in front one minute before half-time with a super solo effort after collecting a threaded Nahitan Nandez through ball behind the River Plate back line -- the striker taking a touch past the last defender and confidently beating goalkeeper Franco Armani with the inside of his right foot.

The strike made Benedetto just the second player ever to score in the first and second leg of the Copa Libertadores final and semifinals, joining Raul Vicente Amarilla, who accomplished the feat with Olimpia in the 1990 edition.

However, River answered Benedetto's opener in the 68th minute through fellow first-leg goal scorer Pratto, who coolly stroked home after a slick passing move down the right side found him unmarked in the middle of the Boca box.

Neither team could find a winner before the end of regulation and the game went to extra time, where Boca immediately went down to 10 men after Wilmar Barrios received a second yellow card for a strong challenge near midfield.

Boca managed to survive the first 15 minutes of extra time without conceding, but Quintero stepped up to play the hero early in the second period. After some quick passing at the top of the Boca box, the Colombia international settled and fired an unstoppable left-footed shot in off the underside of the crossbar to clinch the coveted crown for the Buenos Aires giants before Martinez added a last-second goal after Boca keeper Esteban Andrada had pushed into the Rover box in desperate search for an equaliser.

"I didn't think about it," Quintero said of his goal. "Camilo [Mayada] passed it to me and I looked for space and then hit it. It was a lovely goal and you have to celebrate it."

Martinez added: "We were the only team out there that tried to win. We played the whole match in their half of the field."

The Copa title pulls River even with fellow Argentine side Estudiantes with four, fourth most in the competition's history but still two fewer than Boca.

The victory also means they will represent South America in the Club World Cup that kicks off on Dec. 12 in the United Arab Emirates and guarantees them bragging rights over their neighbours for many years to come.

The club are expected to fly directly to the Middle East but striker Lucas Pratto said the players would take some time to celebrate before their first match on Dec. 18.

"We want to enjoy this because I don't think we'll win another Cup against Boca like this," said Pratto.

The game was controversially moved 10,000 kilometres away from River's Monumental stadium to Madrid as Boca's team bus had been ambushed before the originally scheduled game, leaving several Boca players injured from the impact of the smashed windows and from tear gas that had been fired by police.

It meant that instead of a home game with the exclusive presence of River supporters, Real Madrid's Bernabeu was equally-divided between fans of both sides, a highly unusual situation in the Copa Libertadores, South America's equivalent of the Champions League.

The final, the first in the 58 years of the competition to be played outside of Latin America and the first between Argentina's two biggest clubs, provoked furious protests from both clubs, their fans and leading figures in Argentine football. Luis Cesar Menotti, Argentina's 1978 World Cup winning coach, called the switch "an aberration".

River decried the loss of home advantage Boca had enjoyed in the first leg, while Boca claimed they should have been awarded the trophy by default, pointing to when they were thrown out of the competition in 2015 when River players were attacked with pepper spray at halftime.

There was also a deep sense of irony at the fact a competition named in honour of the liberators of south America was to be played in the home of their former rulers.

Despite the controversy, a total of 10,000 fans made the long journey over from Argentina for the occasion, with the nation's considerable expatriate communities across Europe (250,000 reside in Spain alone) also flooding in to the Spanish capital, creating a carnival atmosphere that was mostly cordial.

The VIP box was stuffed with the biggest names in the game, from Barcelona captain Lionel Messi and Atletico Madrid coach Diego Simeone and forward Antoine Griezmann, to FIFA president Gianni Infantino and Real chief Florentino Perez.

Spanish police had mounted the biggest ever security operation for a football match in the country, deploying over 4,000 personnel including more than 2,000 police officers.

The security costs were countered by a considerable windfall for the city, which local government officials put at an estimated minimum 55 million euros.