NEW YORK (CBSNewYork)- The New York Jets have agreed to a deal with San Francisco 49ers defensive coordinator Robert Saleh to become the organization’s next head coach.

The team tweeted Thursday night that they have reached an agreement in principle with Saleh. It’s reportedly a five-year deal.

READ MORE: Pfizer Says COVID Vaccine Safe, Effective For Kids Ages 5 To 11

Saleh will become the Jets’ 20th head coach in franchise history.

The Jets interviewed many candidates virtually, but Saleh was the first to get a second interview when he flew to Florham Park and met with the Jets on Tuesday.

He left the building without a deal Wednesday for another interview with the Philadelphia Eagles.

Saleh was a highly coveted head coaching candidate, CBS2’s Otis Livingston reports. He interview for six of the seven vacant NFL jobs.

READ MORE: FBI Executes Search Warrant At Home Of Gabby Petito's Fiancé Brian Laundrie

MORE: Jets’ Robert Saleh Makes History As NFL’s First Muslim Head Coach

This comes off one of the worst seasons in franchise history. The Jets fired Adam Gase the night of the regular season finale and began their search.

Gase went 9-23 in two seasons.

Saleh makes history, becoming the first ever Muslim-American head coach in the NFL.

The 41-year-old has spent the last four seasons running the defense for Kyle Shanahan’s 49ers team, helping to lead the team to a Super Bowl appearance in 2020, where they fell just short against the Kansas City Chiefs. The ‘Niners have ranked in the Top 10 of Football Outsiders defensive efficiency metric in each of the last two seasons including a number two ranking in 2019 when the team went to the Super Bowl.

MORE: Jets Fire Head Coach Adam Gase Following 2-14 Season

Prior to his time with the 49ers, Saleh worked as a linebackers coach under Gus Bradley in Jacksonville and was a defensive quality control coach in Seattle with Bradley before that. He began his coaching career at Michigan State in 2002 as a defensive assistant for Bobby Williams.

Saleh played college football at Northern Michigan University where he started at tight end all four seasons. The job with the Jets will mark his first head coaching experience.

CBS2’s Otis Livingston contributed to this report.

MORE NEWS: De Blasio: Isaabdul Karim, Parolee Who Died Sunday At Rikers, Not Among 191 Set For Release

MORE FROM CBS NEW YORK

CBSNewYork Team