The MLS club officially announced Lionel Messi on Saturday evening ahead of a presentation to be held on Sunday.
Former Barcelona forward Messi was available after allowing his contract to run down with French champions Paris Saint-Germain.
Barcelona were interested in bringing Messi back to the Nou Camp, but an offer did not materialise due to LaLiga's financial fair play rules.
There was also interest from Saudi Arabia, where Cristiano Ronaldo, Karim Benzema and N'Golo Kante now play, but Messi chose to join Inter Miami, who only became an MLS team in 2020 having been founded two years earlier.
"I'm very excited to start this next step in my career with Inter Miami and in the United States," said Lionel Messi.
"This is a fantastic opportunity and together we will continue to build this beautiful project. The idea is to work together to achieve the objectives we set, and I'm very eager to start helping here in my new home."
Lionel Messi will first be available for selection for Inter Miami CF on July 21 when they take on LIGA MX side Cruz Azul in the opening match of the Leagues Cup - a new tournament in which MLS and LIGA MX will pause their respective league seasons from July 21 to August 19 to determine the three clubs that will qualify for the 2024 Concacaf Champions Cup.
Inter Miami co-owner Beckham said the move was "a dream come true".
"Ten years ago, when I started my journey to build a new team in Miami, I said that I dreamt of bringing the greatest players in the world to this amazing city," he said. "Players who shared the ambition I had when I joined LA Galaxy to help grow football in the USA and to build a legacy for the next generation in this sport that we love so much.
"Today that dream came true. I couldn't be prouder that a player of Leo's calibre is joining our club, but I am also delighted to welcome a good friend, an amazing person and his beautiful family to join our Inter Miami community.
"The next phase of our adventure starts here, and I can't wait to see Leo take to the pitch."
The seven-time Ballon d'Or winner is signing for a team that are bottom of the Eastern Conference.
Cindy Parlow Cone, president of US Soccer Federation told Sky Sports: "The great thing about Lionel Messi coming over is it's going to attract domestic and international attention onto the league and to the players and to the teams.
"It's a massive move that MLS and Miami have been able to put together. And I think the Messi impact, I don't think anyone has actually fully wrapped their brain around what that is going to mean for our country and for MLS."