A first-round draft pick in 2011, Smith was due to earn $6.898 million in the final year of his rookie contract.
The Ravens' long-term commitment is a sign that Smith is progressing well in his return from surgery. Coach John Harbaugh suggested in January that Smith would be ready for offseason practices in May.
Smith, 26, is one of Baltimore's most valuable defensive players, as veteran Lardarius Webb was exposed against top receivers down the stretch last year.
With Smith locked up for the foreseeable future and recent draft picks such as linebacker C.J. Mosley, defensive end Timmy Jernigan and nose tackle Brandon Williams taking on the look of budding stars, general manager Ozzie Newsome has succeeded in restocking his defense following the losses of future Hall of Famers Ray Lewis and Ed Reed in 2013.