Nolan Arenado and the Colorado Rockies have agreed to an eight-year contract, the team announced Tuesday night.

The contract is worth $260 million, locking up the star third baseman with a deal that could last through the 2026 season, league sources told ESPN.

The deal, which replaces Arenado's previous one-year contract, includes a full no-trade clause, according to sources.

After months of discussions, the agreement came together in recent days after the Rockies guaranteed an eighth season, according to sources. The deal, which will keep Arenado from reaching free agency after the 2019 season, will set a per-year record for position players. It also includes a player opt-out after the 2021 season.

Arenado, 27, is a four-time All-Star who has won a Gold Glove in all six of his major league seasons. He has led the National League in home runs three times, including 2018, when he hit .297/.374/.561 with 38 home runs and 110 RBIs.

While numerous teams were giddy at the idea of pursuing Arenado in free agency after the 2019 season, according to sources, he opted for the security of more than a quarter-billion dollars guaranteed by the Rockies. One of those teams was the Los Angeles Dodgers, who could step up their pursuit of current free agent Bryce Harper, with whom they met in Las Vegas on Sunday night, according to sources. The Dodgers are seeking a shorter-term deal than the decade-plus-long contract Harper is seeking.

Nolan Arenado: Past 4 Seasons Nolan Arenado has been one of baseball's elite power bats and run producers over the past few seasons. He's also the only player to have won a Gold Glove in each of the past six seasons. MLB Rank HR 158 3rd RBI 503 1st XBH 336 1st -- ESPN Stats & Information

The overall value of Arenado's deal fell short of the $300 million that free-agent third baseman Manny Machado received from the San Diego Padres, but it topped Machado's $30 million annual salary, as well as the $31 million Miguel Cabrera receives each year from the Detroit Tigers. Only Arizona Diamondbacks starter Zack Greinke, at $34.4 million, will have a higher average annual salary than Arenado's $32.5 million.

Over his first six seasons with Colorado, Arenado has hit .291/.346/.539 with 186 home runs and 616 RBIs -- both tops among NL players. His glove is widely regarded as even better than his bat, with highlight-reel plays practically a nightly occurrence.