SEATTLE — Jean Segura and the Mariners agreed Wednesday to a $70 million, five-year contract covering 2018-22, a deal that brings stability to a shortstop position in flux for more than a decade in Seattle.

Segura is making $6.2 million this year and would have been eligible for free agency following the 2018 season. The contract calls for a $3 million signing bonus, a $9 million salary next season and $14.25 million in each of the following four years. Seattle has a $17 million option for 2023 with a $1 million buyout. Segura gets a full-no trade provision.

Traded three times in five years, Segura said the long-term stability was important — bolstered by the no-trade clause.

“As a player, you choose where you feel comfortable, where you feel like it’s home for you,” he said. “It doesn’t matter how much money you’re going to take, it’s all about how you’re going to feel.”

General manager Jerry Dipoto, who traded Segura from the Angels to Milwaukee in a 2012 deal for pitcher Zack Greinke, said he understood the importance of the no-trade request.

“I feel like in this case, because of the amount of times that Jean has moved, I didn’t think it was an unreasonable ask because of how many times he’s been asked to move,” Dipoto said.

“And, the fact that he wants to be here and he wants to play for the Mariners, we’re buying a six-year stretch of Jean’s career that will span, including this year, his age 27 through potentially his age 33 season. It’s a good buy for the Mariners,” he added.

Segura was the centerpiece of one of Seattle’s biggest offseason moves when he was acquired from Arizona as part of a five-player trade. After leading the National League in hits last season, Segura has not disappointed in his move to the American League. Despite two stints on the disabled list, he was leading the AL in hitting with a .341 average.

“Over the past two seasons, Jean has been one of the premier offensive players in baseball,” Dipoto said in a statement released earlier in the day. “His combination of average, power and speed is extremely difficult to find, especially as a top-of-the-lineup hitter at a key defensive position like shortstop. We are all quite excited about having him here with the Mariners and believe he is a key ingredient in our ongoing effort to build a championship-level roster.”

Segura is currently out with a high right ankle sprain that could keep him on the disabled list for up to a month. He also missed time in April with a hamstring injury.

But when healthy, Segura has been one of the best middle infielders in baseball the past two seasons. Segura hit .319 with 20 home runs, 33 stolen bases and 63 RBIs for the Diamondbacks last year after he was acquired in an offseason trade from Milwaukee. Segura was an All-Star with the Brewers in 2013.

“He’s a hit collector,” Dipoto said. “Whether it’s a good pitch or bad pitch, he finds a way to put a barrel on it and gets a hit. He’s got the legs to hit, he’s got the eyes to hit, and he’s got the hands to hit, and he plays a heck of a shortstop, too.”

Shortstop has proved to be a troubling position for the Mariners ever since Alex Rodriguez left for Texas after the 2000 season. Seattle hasn’t had the same shortstop play the majority of games at the position for more than three seasons since Yuniesky Betancourt was the team’s primary shortstop for parts of five seasons from 2005-09.

Segura has played second base and shortstop in his career and is now locked up with the majority of Seattle’s core players. Robinson Cano is signed through 2023; Kyle Seager through 2021 with a club option for 2022; and Felix Hernandez is signed through 2019.

“We have talked repeatedly over the course of the last two years, or year and a half since I’ve been here, about the core group that’s here and our belief that it isn’t a short window of opportunity to compete,” Dipoto said. “And, this is another example of how we wanted to express that.”