Six-time Pro Bowl safety Eric Weddle has agreed to a two-year deal with the Los Angeles Rams, the team announced Friday.

Sources told ESPN that Weddle could make up to $12.5 million over the two years of the deal, with $5.25 million guaranteed.

RAMS!!!!!!!!!!! — Eric Weddle (@weddlesbeard) March 9, 2019

Weddle, who was released by the Baltimore Ravens on Wednesday, was considered the quarterback of the NFL's top-ranked defense and last season finished third on the team in tackles with 68.

"Eric Weddle is just the consummate football player, the consummate leader," coach John Harbaugh said a day after the Ravens released Weddle. "He will go down in history like that. I think he should be in the Hall of Fame."

Weddle is a key addition to the Rams secondary with the pending free agency of starting free safety Lamarcus Joyner, who played last season on the franchise tag after the sides were unable to agree to a long-term deal.

Weddle, 34, is expected to start alongside strong safety John Johnson III in a secondary that also includes All-Pro cornerbacks Aqib Talib and Marcus Peters.

Weddle's football intelligence was key in the success of the Ravens' defense and allowed Baltimore to change coverages to keep teams off balance. But he recorded a career-low three pass breakups in 2018 and didn't make an interception for the first time since 2015.

He had one year remaining on his contract at a base salary of $6.5 million. Baltimore created $7.5 million in cap space by cutting him.

Getting released was always in the back of his head, but Weddle thought the Ravens would give him a chance to stay in Baltimore.

"It's their decision, and I respect that. No hard feelings," Weddle said. "[GM Eric DeCosta] said, 'We're releasing you,' and said some nice things about me. That was it. They're moving forward. I didn't get any inclination that they wanted to bring me back, which is totally fine. He's moving forward with his plan, and I will be pulling for him."

Weddle contemplated retirement at the end of the season but decided to continue playing because his body was in better shape after this season than recent years.

"It's all about my health and my mindset," Weddle said. "Who knows how long I'll play? [Age] 34-35 is the new 31 with the way guys are playing these days."

Weddle, a 2007 second-round pick, spent his first nine seasons with the Chargers before having a falling-out with the organization.

ESPN's Jamison Hensley contributed to this report.