Unrestricted free agent inside linebacker Dannell Ellerbe is leaving the Ravens.

Ellerbe has reached an agreement with the Miami Dolphins on a multi-year contract, according to a league source with knowledge of the situation.

Ellerbe had been in talks with the Ravens throughout Tuesday, but they were unable to reach a compromise.

Now, Ellerbe heads to the Dolphins, a move that may cost incumbent linebacker Karlos Dansby his job.

A former undrafted free agent, Ellerbe had expressed hope to the Baltimore Sun last week that he might rejoin the Ravens.

He recorded a career-high 89 tackles and 4.5 sacks last season, leading the Ravens with nine tackles in a Super Bowl victory over the San Francisco 49ers.