Financial terms of the deal were not disclosed by the Ravens but multiple reports said Rice, a two-time Pro Bowl running back who powered Baltimore to the AFC Championship game earlier this year, agreed to a contract worth $40 million.
"Ray has been an integral part of us earning the play-offs in each of his four seasons, and that includes helping us get to two AFC Championship games," Ravens General Manger Ozzie Newsome said. "His production on the field speaks for itself, and his leadership in the locker room is outstanding."
Rice, who was assigned a franchise tag in the offseason, had until Monday to reach a long-term deal with the Ravens or he would have had to play 2012 NFL season under a one-year deal worth $7.75 million.
The 25-year-old running back, who was taken by the Ravens in the second round of the 2008 NFL Draft, had a league-best 2,068 yards from scrimmage last season.
He also set a Ravens franchise record with 15 touchdowns in 2011 while also setting career highs for rushing yards (1,364) and rushing touchdowns (12).
The deal gives Rice a chance to become the team's all-time rushing leader as he is currently second, 3,424 yards behind Jamal Lewis.
The Ravens said Rice will likely address the media when he reports to training camp on July 25.
Meanwhile, the Chicago Bears have signed Matt Forte to a four-year contract, ending any chance of the Pro Bowl running back holding out to start the 2012 NFL season.
Financial terms of the deal were not disclosed by the Bears but several media reports said Forte's contract is worth about $32 million.
"We're very pleased that we were able to come to terms on a four-year extension with Matt," Chicago Bears General Manager Phil Emery said. "We're excited to get him on the field and continue working towards our goal of winning a championship."
Forte, who missed the final month of last season with a sprained right knee, rushed for three touchdowns and a team-leading 997 yards during the 2011 NFL campaign.
His injury, which came two weeks after starting quarterback Jay Cutler suffered a season-ending injury, was a major blow for a Bears team that struggled down the stretch and failed to make the play-offs.
Forte, selected in the second round by Chicago in the 2008 NFL Draft, is the only player in league history with 900 rushing yards and 400 receiving yards in each of his first four seasons.
"I've been working hard this offseason and am looking forward to joining my team mates at training camp next week," said Forte. "I'm glad the business part is done and we can all turn our attention to football and our goal of winning a championship."