An early opener from their former Barca star Zlatan Ibrahimovic meant the Catalans had to rally from behind and they would, with goals from Lionel Messi, Neymar and Luis Suarez steadily tightening the hosts’ grip on the game.
With 15 points from six games Barca claimed first place.
Lasse Schone scored a double as Ajax booked their place in the Europa League with a comprehensive 4-0 win over APOEL Nicosia in Group F’s other game.
Davy Klaassen headed in the third, with Arkadiusz Milik’s low strike in the 74th minute wrapping up a comfortable victory.
CSKA Moscow’s Champions League and indeed their European campaign ended with a 3-0 defeat to Group E winners Bayern Munich.
The Russians were one of three sides involved in a confusing tug-of-war to qualify behind Bayern, but this loss and Manchester City’s 2-0 win at Roma means the English side progress.
In fact, CSKA do not even get the consolation of the Europa League.
They could simply not keep their side of the bargain, with Thomas Muller’s penalty — his club-record 24th goal in the competition — and strikes from Sebastian Rode and Mario Gotze doing for them.
In Chelsea’s Group G, Max Meyer secured Schalke’s progression to the last 16 of the Champions League as his goal sealed a 1-0 win at Maribor.
Athletic Club secured a place in the Europa League after two second-half goals saw them home 2-0 against Champions League Group H opponents BATE Borisov at San Mames.
Mikel San Jose’s strike shortly after the restart put Bilbao on course to retain an interest in European competition this season.
Markel Susaeta made sure of the victory with a late finish after making the most of superb approach work by Borja Viguera.
Porto top the group despite being held 1-1 by Shakhtar Donetsk. Both qualify.