The New York Mets and shortstop Francisco Lindor have agreed to a 10-year, $341 million deal, a source told ESPN’s Jeff Passan on Wednesday.

Lindor’s deal will be the third largest based on total value in major league history, trailing only the deals for the Los Angeles Angels‘ Mike Trout ($426.5 million) and the Los Angeles Dodgers‘ Mookie Betts ($365 million).

The Mets were widely expected to sign Lindor to a long-term extension after acquiring the four-time All-Star in a blockbuster trade with the Cleveland Indians this offseason. The negotiations became a major storyline during spring training, with new Mets owner Steve Cohen writing on Twitter last week, “What do think Lindor will accept? I’m going to crowdsource the answer.”

In January, the Mets avoided salary arbitration with Lindor by agreeing to a one-year deal worth $22.3 million. It was the fourth-biggest one-year contract for an arbitration-eligible player, trailing Mookie Betts ($27 million with Boston last year), Nolan Arenado ($26 million with Colorado in 2019) and Josh Donaldson ($23 million with Toronto in 2018).

A two-time Gold Glove winner, Lindor is a career .285 hitter and has averaged 29 homers, 86 RBIs and 21 steals in his six major league seasons — all with the Indians, who drafted him in 2011.