For almost a year, the dispute between the Washington Redskins and star left tackle Trent Williams raged on, stretching across the regimes of three head coaches and sometimes paralyzing the team as Williams refused to play. Then, just before noon Saturday, minutes before the third day of the NFL draft began, the battle abruptly ended: The Redskins traded Williams to the San Francisco 49ers for two draft picks.

“This was an opportunity for us to part ways with a guy who wanted to move forward,” Coach Ron Rivera said in a post-draft teleconference. “We’re going to build the culture [around the team] with the guys who want to be here, with the guys who want to be a part of what we are doing, so we can go forward and feel good about where we are.”

That Williams, a seven-time Pro Bowl player, was dealt for a fifth-round pick Saturday and a third-round selection in next year’s draft seemed anticlimactic given the size of the quarrel between the sides. But Rivera appeared to be through trying to convince Williams to stay, so he dealt him away for far less than a player of his stature is worth.

Kyle Smith, the Redskins’ vice president of player personnel, said the year-long dispute “devalued” Williams, forcing Washington to take a smaller offer than he and Rivera would have hoped for. At some point, he said, the Redskins had to move on.

“I can’t wait to stop talking about it and stop hearing about it,” he said.

It was somewhat fitting that Williams left as Washington began building for the future. The Redskins added a potential superstar in Ohio State pass rusher Chase Young with the No. 2 draft pick Thursday, then grabbed an intriguing playmaker in Memphis wide receiver/running back Antonio Gibson during the third round Friday. As word of the Williams trade came out, they picked his potential replacement, LSU tackle Saahdiq Charles, in the fourth round.

As the final day of the draft wore on, Rivera seemed to be moving away from last year’s 3-13 season under Jay Gruden and interim coach Bill Callahan, not only shedding the frustration of Williams’s dispute but also adding several of the type of versatile players he has coveted since he joined Washington in late December. He believes Young can be a superstar whose pass-rushing skills make the whole defense better. Gibson can be used in multiple places on the field, as can the team’s fifth-round picks: San Diego State’s Keith ­Ismael (at center and guard) and Michigan’s Khaleke Hudson (at linebacker and safety).

Rivera several times mentioned the excitement he felt about the players the Redskins picked, explaining that multi-position players such as Gibson and Liberty wide receiver Antonio Gandy-Golden (taken in the fourth round) will create matchup problems.

“I expect [the draft picks] to be a part of what we are building,” he said.

As Rivera and Smith celebrated, Williams left quietly. He did not offer comment after the trade, but agent Vincent Taylor said in a statement, “Trent Williams is ready to get back to competing in the NFL and is glad to be a part of a great organization like the San Francisco 49ers.”

Washington thought it had a trade in place to send Williams to the Minnesota Vikings on Friday, but the deal fell through. A person with knowledge of the situation said Williams blocked the trade, which he and Taylor denied.

Saturday’s trade reunites Williams with former Redskins offensive coordinator Kyle Shanahan, the 49ers’ head coach. Longtime left tackle Joe Staley announced Saturday that he is retiring, which boosted San Francisco’s need to land Williams.

Although Rivera originally expressed hope he could convince Williams to return after he missed all of last season, those attempts fell apart, and the Redskins gave Williams and Taylor permission to look for a team willing to trade for him and sign him to a new contract. Williams has one year left on a contract that will pay him $14.5 million this season.

A person with knowledge of the situation said Williams will report to the 49ers and then work on a contract extension with the team.

Trade talks stalled in recent weeks as teams were unwilling to meet Williams’s contract demands or Washington’s request for a second-round pick in return. The conversations picked up as the draft drew closer and the Redskins expressed a willingness to accept a package of draft picks to approximate the value of a second-round choice, a person with knowledge of the situation said.

For Williams, the trade is a fresh start after a contentious end to his time with Washington. His battle with the team started in the winter of 2018-19 when a cyst on his scalp — that he says the Redskins’ medical staff told him to ignore — turned out to be a rare but highly survivable form of soft tissue cancer called Dermatofibrosarcoma Protuberans. Williams said when doctors removed the cancer, not long after the diagnosis, it was close to penetrating his skull and going into his brain.

Rattled by the experience and frustrated with the treatment of some of his other injuries, Williams told the team in June that he wanted to be traded. He held out of offseason workouts, training camp and the first half of the season, returning just after the Oct. 29 trade deadline, when the team did not deal him. A week later, he was placed on the non-football injury list, ending his season, and was told to stay away from Washington’s practice facility.

A month later, Williams blasted Bruce Allen, who was still team president at the time, and said he was certain he was finished with the Redskins.

“I don’t see how it can be reconciled,” he said in a November interview with The Washington Post. “At the end of the day, I’m a human being. I ain’t like a dog and you can slap the s--- out of me and I’m going to come back the next morning with my tail wagging.”

Williams is the second talented player that Rivera has traded this spring. Last month, he sent disgruntled cornerback Quinton Dunbar to the Seattle Seahawks for a fifth-round draft pick. Dunbar, like Williams, had a year left on his contract and wanted a new deal. Rivera has said he doesn’t want to sign the players he inherited to extensions without coaching them for a while to be sure they buy into the culture he wants to establish.

In addition to Charles, candidates to replace Williams include Cornelius Lucas, a free agent signee who has started 16 games in his six-year career, and Geron Christian, a 2018 third-round pick who made two starts last season.

More on the NFL draft: