CHARLOTTE, N.C. (AP) — The Carolina Panthers have agreed to terms with former Buffalo Bills quarterback Frank Reich to become their new head coach on Thursday.

The 61-year-old Reich joins the Panthers after spending the past four-plus seasons with the Indianapolis Colts, where he went 40-33-1 as head coach before being fired on Nov. 7 after a 3-5-1 start. The Colts went to the playoffs twice as a wild-card team under Reich, going 1-2 in the postseason.

Reich interviewed with Buffalo in 2017 before the Bills hired Sean McDermott, and current Bills offensive coordinator Ken Dorsey had an interview with the Panthers last Saturday before Buffalo’s divisional playoff game loss.

For Reich, the hire represents a return to Carolina where he spent one season as the team’s quarterback and started the franchise’s inaugural game in 1995.

Carolina Panthers quarterback Frank Reich is sacked by Buffalo Bills’s Phil Hansen (90) during the second half of an NFL football game in Orchard Park, N.Y., Sept. 10, 1995. The Carolina Panthers announced Thursday, Jan. 26, 2023, they have agreed to terms with Frank Reich to become their new head coach. (Bob Leverone/The Charlotte Observer via AP)

Before joining the Colts, Reich worked two years as the offensive coordinator for the Philadelphia Eagles, helping them win the Super Bowl in his second season under head coach Doug Pederson.

NFL analyst and former Panthers general manager Bill Polian, who brought Reich with him from Buffalo to Carolina in 1995 to help mentor first-round draft pick Kerry Collins and provide quarterback stability, called Reich “as fine of a person as you’ll ever meet” and a head coach with “a great football mind.”

“I think he will fit in perfectly in Carolina,” Polian said. “This is where he wants to be. He literally knows the building and has been there as a player. He will bond with the players and put together a great staff. There is a still a lot of building to do with this team, but he will work great with (general manager) Scott Fitterer.”

Polian added that Reich is low key but detail-oriented.

“He’s inspirational when he needs to be,” Polian said. “And he’s very rationale and honest and straightforward with his players.”

Wilks, who is Black, was already part of a lawsuit that included Brian Flores alleging racist hiring practices by the NFL.

Douglas Wigdor, the lawyer who is representing Wilks in the lawsuit, said in a statement to The Associated Press on Thursday “we are shocked and disturbed that after the incredible job Coach Wilks did as the interim coach, including bringing the team back into playoff contention and garnering the support of the players and fans, that he was passed over for the head coach position by David Tepper.”

Wigdor continued: “There is a legitimate race problem in the NFL, and we can assure you that we will have more to say in the coming days.”

The Panthers have been searching for stability at quarterback ever since Newton began struggling with injuries shortly after the team’s 24-10 loss to the Denver Broncos in Super Bowl 50. The Panthers cut Baker Mayfield earlier this offseason and Sam Darnold is an unrestricted free agent, so Reich will have a key say in the future of the team’s quarterback situation.

As of now, Scott Fitterer remains the team’s general manager.

Prior to joining the Colts, Reich worked two years as the offensive coordinator for the Philadelphia Eagles helping them win the Super Bowl in his second season under head coach Doug Pederson.

Reich spent 14 seasons as an NFL quarterback and has been in coaching since 2006 when he initially joined the Colts as an intern.

Panthers owner David Tepper has been eager to establish a winning program since purchasing the team for a then-record $2.3 billion in 2018 from Jerry Richardson, who sold the team amid allegations of sexual and racial misconduct in the workplace.

The Panthers are 29-53 since Tepper purchased the team and have never won more than seven games in a season.

Reich becomes the sixth full-time head coach of the Panthers, following Dom Capers, George Seifert, John Fox, Ron Rivera and Matt Rhule.

Rivera is a minority, but the Panthers have never hired a full-time Black coach. They’ve had two Black coaches who’ve worked on an interim basis — Perry Fewell and Steve Wilks.

The Panthers interviewed nine candidates for the job, including Wilks, who went 6-6 last season. Wilks took over for Rhule, who was fired by Tepper less than three seasons after giving him a seven-year, $72 million contract.

Rhule was 11-27 overall, and the Panthers were 1-4 when he was fired.

Among the others who interviewed included former New Orleans Saints head coach Sean Payton, former Detroit Lions and Colts head coach Jim Caldwell, Denver Broncos defensive coordinator Ejiro Evero and four NFL offensive coordinators — Kellen Moore (Cowboys), Shane Steichen (Eagles), Mike Kafka (Giants) and Dorsey.