The Cardinals get minor league shortstop Rayder Ascanio in exchange for Leake and international cap space totaling $750,000 for the current international signing period.
"Mike gives us an experienced starter that will help us as we navigate our way towards a playoff spot this season," Mariners general manager Jerry Dipoto said in a statement. "As one of the most durable starters over most of the last decade, he'll be a valuable addition for not just the near future, but for seasons to come."
Leake, 29, was 7-12 with a 4.21 ERA over 154 innings with 103 strikeouts in 26 starts for St. Louis this season. He began the season going 6-6 with a 2.97 ERA in his first 16 starts, before going 1-6 with a 6.94 ERA over his last 10.
Leake is under contract through the 2020 season with an option for 2021. He signed a five-year, $80 million deal before the 2016 season.
The trade comes before Thursday's deadline for major league teams to acquire a player and have him be eligible for the postseason. The Mariners (66-67) are three games out of the second wild-card spot in the American League and the Cardinals (66-65) are 5 1/2 games out in the NL wild-card race.
Since his major league debut season in 2010, Leake's 228 starts are the second most in the National League behind the Los Angeles Dodgers' Clayton Kershaw (233). Since the start of the 2012 season, Leake's 180 starts are tied for the most in the National League with the Washington Natioanls' Gio Gonzalez.
In eight major league seasons, Leake is 80-76 with a 4.18 ERA in 233 games, including 228 starts for the Reds (2010-15), San Francisco Giants (2015) and Cardinals (2016-17).
Ascanio, 21, split this season between low-Class A Clinton and high-Class A Modesto, while also appearing in three games with Triple-A Tacoma. In a combined 111 games this season, he hit .217 with nine home runs and 44 RBIs.
Ascanio was signed by the Mariners as an international free agent in 2012 at age 16. The switch-hitting Ascanio, a native of Mariara, Venezuela, has compiled a career batting mark of .240 with 15 homers and 158 RBIs in 425 games at the minor league level.