However, Barca's status in a competition they have won for the last four years is unclear after Levante said before the game that they would file a complaint to the Spanish Football Federation (RFEF) on Friday about the Catalan club.
Levante claim that Barcelona's teenage defender Chumi Brandariz, who played in the first leg, was ineligible to take part in the match because he was suspended.
If the RFEF ruled against the Catalan club, the 30-time Copa del Rey winners would be thrown out, with Levante given a bye and taking their place in the last eight.
With Barca trailing 2-1 from the first leg, coach Ernesto Valverde made five changes and recalled the club's all-time top scorer Messi as well as Jordi Alba and Ivan Rakitic to the team while starting without first-choice striker Luis Suarez.
Barcelona made a flying start and, after numerous forays into the visitors' area, took the lead on the half hour when Dembele latched onto a Messi through ball and chipped into the net with the help of a deflection off a defender.
The France forward struck again less than a minute later, receiving another Messi pass and rounding goalkeeper Aitor Fernandez to double Barca's advantage.
Philippe Coutinho looked to have struck early in the second half but his effort was ruled out for offside following a review by the Video Assistant Referee (VAR).
Messi wrapped up the win in the 54th minute, but the Catalans will not know their fate in the competition until the federation rules on Levante's planned complaint over Chumi.