OWINGS MILLS, Md. (AP) — Justin Forsett agreed to terms Thursday on a three-year contract with the Baltimore Ravens, who keep their leading rusher from 2014 after losing several key free agents earlier in the week.

The 29-year-old Forsett is coming off the finest season of his seven-year career. Thrust into a starting role after the Ravens released Ray Rice, Forsett shed his journeyman label to run for 1,266 yards and eight touchdowns.

His hope was that the Ravens, despite being burdened by the salary cap, could drum up enough money to provide him a multi-year deal at the right price.

"There were some points there where I was like, 'It might be difficult to come back,'" Forsett said. "I'm just glad in the end it all worked out."

Forsett started 14 games in 2014, doubling the amount of career starts he had coming into the season. He also had 40 carries in two playoff games, running for 169 yards, and was selected to his first Pro Bowl after replacing an injured Arian Foster.

Before last year, he totaled 1,692 yards rushing with Seattle, Indianapolis, Houston and Jacksonville.

The timing of his breakthrough year was perfect for the Ravens.

"Sometimes you have fortunate signings in this business and Justin was one of those," Ravens general manager Ozzie Newsome said in a statement released by the team. "We were fortunate because he became such a vital part of our on-field success and quickly became a steadying influence in the locker room at an uneasy time for us. He gave us more than we anticipated. From what we expected, he gave us unprecedented production."

Rice was initially suspended for two games by the NFL for domestic abuse. He was released by Baltimore after a video surfaced showing him hitting his now-wife in an elevator.

Bernard Pierce was expected to be the primary fill-in for Rice, but Forsett ultimately got the job and finished with five 100-yard games, including a 182-yard, two-touchdown effort in New Orleans.

"Justin appreciated the Ravens giving him a shot," said Forsett's agent, Doug Hendrickson. "They opened the door for him and he ran through it. His goal was to stay and build on what he started."

After bouncing around from one NFL city to another, Forsett has finally found a place to call home.

"I'm excited by the commitment," the running back said. "I have a place for my family to be for a while."

Earlier in the week, the Ravens' tight salary cap led to the loss of free agent wide receiver Torrey Smith to San Francisco, linebacker Pernell McPhee to Chicago and tight end Owen Daniels to Denver. In addition, backup quarterback Tyrod Taylor signed with Buffalo on Thursday, two days after Baltimore traded defensive tackle Haloti Ngata to Detroit.

Retaining Forsett eased some of the sting.

"He fits well into what we do on offense," Newsome said. "Justin is a tremendous leader by example and willing to step up as both a leader and mentor. He is truly a success story, and we're happy he'll continue that with us. He earned his new contract."

___

AP NFL website: www.pro32.ap.org and www.twitter.com/AP_NFL