Levante moved to 10th place with the win, its second in three matches.

Messi led Barcelona to victory with a hat trick in the first 40 minutes and another goal near the end of the rout against Eibar, ending a four-game scoreless streak that marked his worst run in six years in the Spanish league.

Arthur also scored for Barcelona at the Camp Nou after an assist from debuting striker Martin Braithwaite.

It was the fourth league win in a row for Barcelona, which has been enduring one of its worst institutional crises amid a controversial coaching change and public conflicts between players and club directors. President Josep Bartomeu was jeered by the crowd at the Camp Nou, with some of the fans calling for his resignation.

“We needed a game like this, when we did things well and everything went our way,” Barcelona coach Quique Setién said.

It was the seventh time Messi scored four or more goals in a game with Barcelona.

Real Sociedad routed Valencia 3-0 to jump from eighth to fourth in the standings, grabbing a qualification spot for the Champions League.

Mikel Merino, Nacho Monreal and Adnan Januzaj scored for Real Sociedad, which has won three of its last four league matches.