Financial terms of the deal were not disclosed, but it's worth a reported $61 million, including $40 million over the first two years, and makes Ngata the highest paid non-quarterback in the NFL.
"This is a great feeling, and I can't explain how many different emotions I have," Ngata said. "What I want to do now is continue to get better every year and help the team get better. Our goal is to win Super Bowls, and I want to do my best to help us make that happen."
The Ravens put the non-exclusive franchise tag on the two-time Pro Bowl selection on February 15, meaning he was playing for nearly $12.5 million this season if a new deal couldn't be worked out before Tuesday's 4 p.m. (et) deadline to take the tag off a player.
The No. 12 overall pick in the 2006 draft has been a force in the middle of Baltimore's line. Ngata had 63 tackles and a personal-best 5 1/2 sacks last season.
He has 257 tackles, 12 sacks and three interceptions in his career.
"He is obviously instrumental to everything we do on defense," Ravens executive vice president and general manager Ozzie Newsome said in a statement. "He's a player who commands an offense's attention every single play, and his presence allows us to play a variety of effective defenses. Teams have to prepare for Haloti every week."