Dwyane Wade is staying with the Miami Heat, and his latest deal is designed to give both the player and the only franchise he’s ever known some flexibility in the coming years.

Wade signed a new contract with the Heat on Tuesday. It’s a two-year deal, the second of those seasons a player option, said a person familiar with the situation. The person spoke to The Associated Press on condition of anonymity because neither side announced terms.

“Home Is Where The Heart Is... My Home,My City,My House,” Wade wrote on Twitter, then used the phrase “HeatLifer” when attaching a photo of himself standing below the three NBA championship banners that hang at the arena the Heat call home in Miami.

Financial terms were not announced, though it’s expected Wade’s salary for next season will not reach the $20.2 million he would have made under his previous contract.

Heat President Pat Riley confirmed that Wade again bought into the Heat mantra of sacrifice. The contract he signed four years ago left millions on the bargaining-room table, in part to make the deals with LeBron James, Chris Bosh and Udonis Haslem happen.

“Dwyane has been the franchise cornerstone for this team since the day he arrived 11 years ago,” Riley said. “He has shown his commitment to the Heat many times over the course of his career and has always been willing to sacrifice in order to help build this team into a champion. This time is no different.”

Wade’s return was not in any way unexpected, yet still represents a huge win for Miami during free agency — especially since it comes less than a week after James left the Heat after four seasons and returned to the Cleveland Cavaliers.

So now, what was the “Big 3” is a “Big 2.” Bosh is in the process of finishing a $118 million, five-year contract with Miami.

Wade is entering his 12th Heat season and is the franchise’s all-time leader in games, points, assists and steals. He and Haslem, who is also expected to complete a new two-year contract with Miami in the coming days, are the only players to appear on all three of the Heat teams that won NBA championships in 2006, 2012 and 2013.

He was limited to 54 games last season, in large part because of a maintenance program designed to limit wear and tear on his knees. But when he was on the floor, he was effective — shooting a career best 54.5 percent and averaging 19.0 points.

With James gone, Wade likely won’t have the luxury of resting as much this season.

He’s averaged 24.3 points for his career, 16th-best in NBA history and fifth-best among active players with at least seven seasons. And only seven other players in league history have as many points (17,481), rebounds (3,605), assists (4,301), steals (1,262) and blocked shots (696) as Wade has posted so far in his career.

Wade could have lobbied for more money — Bosh, for example, got a max deal — or insisted on more years. But the Heat are positioning themselves to have as much flexibility as possible in 2016, a similar approach to what brought the “Big 3” together in 2010, and Wade taking what would be at the most a two-year deal helps them greatly in that regard.

Wade still has a hectic summer ahead. There’s an upcoming marriage to actress Gabrielle Union, the ongoing building projects at the home he’s been remodeling for some time, and the annual fantasy camp that he hosts.

His biggest order of business, however, is now complete.

“I am ecstatic to have him back in the fold and I am confident that Dwyane, as always, will be leading this team as we look to contend for NBA championships,” Riley said.