The Las Vegas Raiders have given quarterback Derek Carr a three-year contract extension, a person with knowledge of the deal tells The Associated Press.

The extension is worth $121.5 million, the person said, speaking Wednesday on condition of anonymity because the deal has not been announced.

Despite all sorts of turmoil with the Raiders last season, including the resignation of coach Jon Gruden, Carr helped them to the playoffs as a wild card in the tough AFC West. He threw for a career-high 4,804 yards and 23 touchdowns as Las Vegas went 10-7 before losing at Cincinnati in the postseason.

An eight-year veteran, Carr, 31, was entering the final year of his deal, worth nearly $19.8 million in base salary. When healthy, he has been a starter for nearly all of that time with the Raiders and has made three Pro Bowls.

That contract was for five years at $125 million, the richest in the NFL at the time he signed it in 2017. The new deal puts him more in line with what veteran starting quarterbacks make throughout the league.

Last month at the owners meetings, new Raiders coach Josh McDaniels seemed to stress the importance of finding the money for Carr.

”If you’re not trying to win, I don’t know what you’re doing at this point,” he said. ”I think we are all in that mode of trying to do what’s best for our football team so we can compete and win as many games as possible. That’s what they pay us to do.”

Extending Carr, the Raiders’ career leader in yards passing with 31,700 and touchdown passes with 193, is the latest move in a busy offseason. Carr will have All-Pro Davante Adams added to his receiving group in a trade with Green Bay, and standout pass rusher Chandler Jones as a free agent.

More AP NFL: https://apnews.com/hub/nfl and https://apnews.com/hub/pro-32 and https://twitter.com/AP-NFL