Dario Benedetto put Boca ahead on at the end of a bruising first half at the Santiago Bernabeu stadium.
But River, who also came back twice in the 2-2 draw in the first leg at Boca’s Bombonera stadium, leveled in the 68th minute through striker Lucas Pratto after a superb team move.
River was given a huge advantage when Boca midfielder Wilmar Barrios was sent off in the third minute of extra-time and seized it thanks to a sizzling strike from Colombia international Juan Fernando Quintero in the 109th minute.
Gonzalo Martinez sealed the victory, 5-3 on aggregate, at the death with a tap-in after Boca’s entire team had poured forward in search of an equalizer, giving River a fourth Libertadores title and denying Boca a record-equalling seventh.
River’s victory means they will represent South America in the Club World Cup that starts in the United Arab Emirates on Dec. 12.
The game was moved 10,000 kilometers 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.