LAKE FOREST, Ill. -- The Chicago Bears have agreed to a new deal with defensive coordinator Vic Fangio, the team announced.

Fangio's contract is for three years, a league source told ESPN's Adam Schefter.

The Bears interviewed Fangio, 59, for their head coach position last week. General manager Ryan Pace ultimately tabbed former Kansas City Chiefs offensive coordinator Matt Nagy to succeed John Fox, whom Pace fired at the end of the regular season.

Editor's Picks

Matt Nagy is bringing three former Bears assistants back to Chicago and will have former Oregon head coach Mark Helfrich as his offensive coordinator.

Still, the Bears and Nagy were eager to retain Fangio, who inherited one of the NFL's worst defenses in 2015 and coached the unit back to respectability over the course of three seasons.

The Bears' defense finished in the top 10 in passing yards (seventh), points allowed (ninth) and total yards (10th) allowed in 2017. Chicago ranked 11th in rushing defense.

"That's a very important hire for me," Nagy said during his introductory news conference. "There are a lot of things that go into that decision, and Vic and I have talked. We understand that. We understand the situation. ... We're going to attack that full steam ahead, and we're going to make a clear decision about what's best for Vic and what's best for this organization."

Fangio had been in discussions with the Bears the past few days about a possible return, even though he was free to negotiate with other clubs beginning Tuesday.

Fangio was believed to have been a candidate for defensive coordinator with the Green Bay Packers. But the Packers hired former Cleveland Browns head coach Mike Pettine on Wednesday, a day after the Los Angeles Chargers announced they had reached an agreement to retain their defensive coordinator, Gus Bradley.

Fangio has coached a total of 31 years in the NFL, with additional stops in Baltimore, Houston, Indianapolis, Carolina and New Orleans.

The Bears officially announced the hiring of offensive coordinator Mark Helfrich and special-teams coordinator Chris Tabor earlier on Friday.