The Carolina Panthers agreed to terms with quarterback Cam Newton on Thursday, the team announced, reuniting the franchise with its career leading passer and one of its most popular players less than two years after it released him.

The move adds stability to the Panthers after their starting quarterback, Sam Darnold, injured his right shoulder on Sunday against the New England Patriots. Darnold is expected to miss multiple games. The Panthers’ backup, P.J. Walker, has started only one game in his two-year pro career, and the team recently signed the journeyman Matt Barkley.

After the Panthers cut Newton, the Patriots signed him in July 2020, and he started 15 games for them last season. But the Patriots released him near the end of this training camp, electing to start a rookie, Mac Jones, whom the team drafted No. 15 overall this spring. In August, a misunderstanding of Covid-19 protocols forced Newton to miss several days of practice — a sign that he had not been vaccinated. His absence allowed Jones to practice with the Patriots’ starters.