A weakened Barca side drew the first leg 1-1 last week.
But they named a stronger line-up for the home game, and Messi swept in twice from Jordi Alba crosses.
The Argentine then set up Alba to slide home a goal, Luis Suarez scored from Pione Sisto’s poor back-pass and Ivan Rakitic headed a late fifth.
It was the first time Alba, who has assisted seven of Messi’s strikes this season, has been involved in three goals in a Barcelona game.
Real Madrid and Atletico Madrid are also in the last eight, along with Valencia, Leganes, Alaves, Espanyol and Sevilla.