Rakitic cut out his clearance and found Dembele, he squared to Messi, and the captain curled a right-foot strike high into the net. The game was put beyond the sight of Sevilla after Luis Suarez's goal in the injury time.
With his hat-trick, the five-time Ballon d'Or victor went up to 25 league goals for the season, increasing his lead in the European Golden Shoe race.
During his career Messi has scored 29 league goals against Sevilla and in total 36 goals in 35 matches against the fellow top-flight club in all competitions.
Sevilla took the lead twice in the first half from a Jesus Navas counter-attack strike and Gabriel Mercado's eight-yard finish.
But with 67 minutes gone Messi was on target again, curling the ball home from the edge of the box to make it 2-2, and he was soon close to a hat-trick when keeper Tomas Vaclik diverted his effort over the bar.
The Argentine capped his stellar performance by playing Suarez clear to add another goal in stoppage time.
Sevilla are Messi's favorite victims, and past year he came off the bench to score twice in two minutes and rescue a 2-0 draw from 2-0 down.
Judge Orders New Hearing With Roger Stone After Instagram Post
District Judge Amy Berman Jackson with what appeared to be crosshairs near her head. If Roger Stone was trying to get Judge Amy Berman Jackson's attention, it worked.
Here is how Twitter reacted to Lionel Messi's hat-trick.
Sevilla fell to fifth, slipping out of the Champions League places behind Getafe.
"We just need to be patient and persevere, which is what he is doing, and the players and I are very patient with him because he's a great player".
The win sends Barca 10 points clear of second-placed Atletico Madrid, who face Villarreal on Sunday, while next weekend's opponents Real Madrid are 12 back ahead of their trip to Levante.
He said: "The last time they had an extra day's rest we beat them 5-1!" "Today we were ourselves again and we played a great game".
Defender Samuel Umtiti played his first match for Barcelona after being sidelined since late November with a left knee problem that has plagued him since helping France win the 2018 World Cup.