Sources familiar with the deal told ESPN that the contract's total value is $51 million.
"I love Seattle. I've loved it ever since I put on that jersey for the first time," Crawford said before the Mariners' season opener against the Minnesota Twins. "I've really wanted to stay here ever since then. So I'm really happy for this opportunity."
Crawford, 27, has emerged as one of the best defensive shortstops in baseball and a fixture in the leadoff spot for the Mariners, who narrowly missed the postseason last year and expect to contend in the American League West for the foreseeable future.
He could shift further down in the batting order this season after Seattle acquired Adam Frazier in the offseason. Crawford was batting eighth in the opener against Minnesota.
Since acquiring him in 2019 from the Philadelphia Phillies, where Crawford broke in as a highly touted prospect, Seattle has regarded him as its shortstop of the future. The commitment in the deal, which runs through 2026, speaks to that.
"J.P. brings excellent defense at a critical position, in addition to solid on-base skills and a penchant for delivering in the big moment," Mariners president of baseball operations Jerry Dipoto said in a statement. "He's an incredibly competitive player who has become an integral part of our team, both on the field and in the clubhouse."
The Mariners bought out two years of free agency with the contract, which this year will pay Crawford $5 million -- slightly more than the $4.85 million he was previously scheduled to make -- and includes a $5 million signing bonus, sources said. Crawford is due $10 million per year from 2023 to 2025 before receiving $11 million in the final season of the deal.
Even before contract talks started, Crawford received reassurance from Dipoto and the front office about being in their future plans as the team's shortstop after Seattle opted not to pursue any of the big free agents at that position in the offseason.
"It says a lot about trust, and I want to think you for trusting me," Crawford said. "This is my team. It is permanently now, and I'm ready to lead these guys."
Crawford said he was at a low point in his career toward the end of his time in Philadelphia. After he arrived in Seattle, he received helpful guidance from veteran Dee Strange-Gordon to help start his turnaround.
"He took me under his wing and showed me how to really love baseball again," Crawford said. "He showed me the passion for it again, and he just taught me how to have fun again."
With limited long-term deals on the books, the Mariners possess significant financial flexibility as they look to build on 2021. They will start the season with Julio Rodriguez, among the most touted prospects in the game, on their Opening Day roster; and the additions of reigning AL Cy Young winner Robbie Ray and slugger Jesse Winker, plus a full season of hard-throwing right-hander Logan Gilbert, have made the Mariners a trendy pick and capable of winning their first World Series.
Crawford helped key the turnaround in 2021, batting .273/.338/.376 with 46 extra-base hits and playing superlative defense a year after winning a Gold Glove. While his strikeout rate climbed last year, his keen eye at the plate and strong bat-to-ball skills make up for a relative lack of power.
With Rodriguez, Winker, Jarred Kelenic, Mitch Haniger, Ty France and others, the Mariners don't necessarily need to depend on Crawford's bat. But an offensive uptick is possible, with Crawford's nine home runs last season representing a career high.
The Associated Press contributed to this report.