Video: Messi's four goals lead Inter Miami to a historic win in the American league
The Argentine opened the scoring from a free kick that deflected off a player and changed direction in the 40th minute, then doubled his tally in the 52nd after a stunning individual run.
Having teed up team-mate Luis Suárez, Messi completed his hat-trick with a clever chip over the goalkeeper seven minutes before the end of normal time.
In stoppage time, he stepped up to take another free kick and curled it with his usual precision into the corner.
Casemiro summed up the Miami mood to Apple TV. "This is what it means to have Messi in the team. We have to enjoy these moments, because he is a person and a player who makes history.
He added: "Today we saw that we have to enjoy it, keep supporting him and competing alongside him, because he is still the best. He proved that at the World Cup. We have to enjoy his presence, because with him we are much stronger."
It was the eighth time in Messi's legendary career that he has scored four goals or more in a single match, and the first since joining Inter Miami.
His last four-goal haul came in February 2020, when he ran riot against Eibar in La Liga.
At 39, he also became the fastest player in Major League Soccer history to reach 20 matches with two or more goals in the regular season, hitting the mark in just 72 games.
Messi leads the MLS scoring charts this season with 18 goals in just 19 matches, two clear of FC Dallas striker Petar Musa.
Interim coach Guillermo Hoyos, sent off during the match, was left grasping for superlatives. "There are no words to describe this footballing beauty. There is so much happening that words simply fail to describe it.
He added: "He is constantly searching for the goal, for this play, for this pass. I don't think he is an ordinary footballer. Analysing his character, whether as a player or as a person, goes so deep that you run out of words."
Victory was Inter Miami's first in Major League Soccer since 25 July, ending a run of five matches without a win in all competitions, including the Leagues Cup.