FILE - In this Jan. 11, 2020, file photo, San Francisco 49ers defensive end Arik Armstead, left, and defensive tackle DeForest Buckner (99) react to a play against the Minnesota Vikings during the first half of an NFL divisional playoff football game in Santa Clara, Calif. The defending NFC champion 49ers signed Armstead to a five-year contract worth up to $85 million on Monday, March 16, 2020, to keep him off the open market and then immediately agreed to a deal to send Buckner to Indianapolis. (AP Photo/Tony Avelar, File)
FILE - In this Jan. 11, 2020, file photo, San Francisco 49ers defensive end Arik Armstead, left, and defensive tackle DeForest Buckner (99) react to a play against the Minnesota Vikings during the first half of an NFL divisional playoff football game in Santa Clara, Calif. The defending NFC champion 49ers signed Armstead to a five-year contract worth up to $85 million on Monday, March 16, 2020, to keep him off the open market and then immediately agreed to a deal to send Buckner to Indianapolis. (AP Photo/Tony Avelar, File)

SANTA CLARA, Calif. (AP) — The San Francisco 49ers locked up two defensive starters with long-term contracts and made plans to deal another to add a needed draft pick and salary cap room.

The defending NFC champions signed defensive lineman Arik Armstead to a five-year contract worth up to $85 million and agreed to a three-year deal with safety Jimmie Ward on Monday, while also agreeing to trade defensive tackle DeForest Buckner to Indianapolis.

A person familiar with the trade said the 49ers will acquire the No. 13 overall pick in this year's draft from the Colts. Buckner will receive a new contract worth an average of $21 million a year, the person said on condition of anonymity because neither the trade nor the contract can become official until the start of the league year on Wednesday.

It was a dramatic series of moves for a Niners team that rode the strength of the defensive line all the way to the Super Bowl. But with Armstead needing a new contract as a potential free agent, it proved too difficult to keep both him and Buckner.

Buckner was owed about $12.4 million this season on the fifth-year option of his rookie contract and was seeking a long-term deal that would make him the second-highest paid defensive tackle behind Rams star Aaron Donald.

That led to a trade that will give San Francisco another first-round pick to go with its own at No. 31. The Niners currently have no picks in the second, third or fourth rounds thanks to previous trades and could look to trade down with one of their picks to fill those voids.

It came at a heavy cost as the Niners dealt away the player the coaches voted as team MVP last season. Buckner was picked seventh overall in 2016 and was one of the few bright spots on a losing team his first three years.

He has been extremely durable, missing only one game in four seasons and having the third-most defensive snaps among linemen since 2016. His 143 quarterback pressures are the fifth-most among all interior linemen over the past four years, according to NFL NextGen stats.

Buckner had a career-high 12 sacks in 2018 and then had 7 1/2 last season as part of perhaps the league's top defensive line with Armstead and edge rushers Nick Bosa and Dee Ford.

Now Buckner will try to bolster an Indianapolis defense in bad need of help at defensive tackle after recording the third-lowest pressure rate from the interior last season, according to NextGen stats.

"We need to get more interior pressure," general manager Chris Ballard said in January. "The three-technique drives this thing. Everywhere I've been that's the case. If a team goes 80 on us, dinking and dunking down the field, I can live with that. What burns me is giving up shots. Giving up explosive plays."

The Colts were so convinced Buckner fit the role that Ballard, who relishes stockpiling draft picks, gave up a chance to potentially select a quarterback in the first round in April.

Ballard locked up left tackle Anthony Castonzo with a two-year contract Sunday, giving him flexibility to do other things.

The Colts then released defensive tackle Margus Hunt just one year after re-signing him. That decision cleared about $4 million in salary cap room.

Armstead had a breakthrough season in 2019, leading to his new contract. He was a first-round pick by San Francisco in 2015 but didn't make a big impact in his first four seasons in the NFL as he dealt with injuries that limited his playing time in 2016 and 2017 and tried to find the right fit for his skills.

It all came together last season under a simpler scheme put in place by new defensive line coach Kris Kocurek. Armstead led the Niners with 10 sacks after getting only nine in 46 games over his first four seasons. He also ranked second on the team with 35 quarterback pressures despite spending significant time playing inside. He was a force against the run, too.

"Arik's physical tools and versatility have allowed him to be highly productive in our style of defense, and we look forward to watching him take his game to an even higher level as he grows within our scheme," general manager John Lynch said. "Arik has been an impact player on the field and a difference-maker in our community, and we are excited for what the future holds for him."

Ward also had his best season after dealing with injuries earlier in his career that forced him to miss 29 games over his first five seasons after being drafted in the first round in 2014.

Ward missed the first three games last season with an injury but then was a key part of the defense that helped the Niners reach the Super Bowl, where they lost to Kansas City.

The Niners also have a key decision to make on free agent receiver Emmanuel Sanders, but could opt to use one of their two first-round picks to fill that void if Sanders leaves.

San Francisco signed backup tackle Shon Coleman on Monday to keep him off the open market.

___

AP Sports Writer Michael Marot in Indianapolis contributed to this report.

___

More AP NFL: https://apnews.com/NFL and https://twitter.com/AP_NFL