Lowry announced the news that he was signing with Miami on social media.
The Heat also agreed to bring back restricted free agent Duncan Robinson on a 5-year, $90 million deal, his agent, Jason Glushon, told Wojnarowski on Monday.
The deal, the largest ever for an undrafted player, includes an early termination option in the fourth year.
Lowry, who turned 35 in March, has been with the Raptors since they acquired him in an offseason trade in 2012. Over the past nine years, Lowry has turned himself into arguably the greatest player in franchise history, holding the franchise records for 3-pointers made, assists, steals and triple-doubles, and placing inside the top 10 in virtually every other category.
He’s re-signed with Toronto twice before — a four-year, $48 million deal in 2014, and a three-year, $100 million deal in 2017 that he later extended by a year to push his free agency to this offseason.
Lowry, who averaged 17.2 points and 7.3 assists last season for Toronto, entered the offseason as one of the top free agents on the market, despite being one of the older players to become an unrestricted free agent.
The six-time All-Star remains a very effective two-way player, with his ability to play both on and off the ball, as well as being an excellent defender, making him a coveted piece for contenders to pursue.
Robinson set franchise marks with the Heat for most 3-pointers in a quarter, half and game. In his second season, Robinson set the Heat franchise record for most 3s in a season, and in his third season set the NBA record for the fastest player ever to reach 500 career 3-pointers.
Undrafted out of the University of Michigan in 2018, Robinson signed a summer league contract with the Heat, then agreed to a two-way deal for the following season.
Robinson was a critical element to the Heat’s offensive system and the definition of a specialist, with 613 of his total 717 shot attempts coming from long range last season.
Robinson, 27, averaged 13.1 points in 72 games last season, hitting 40.8 percent from 3 on 8.5 attempts per game.
ESPN’s Tim Bontemps and Royce Young contributed to this report.