The deal is for five years and up to $35 million, including $8.5 million next season, according to ESPN's Adam Schefter.
Dumervil became a free agent when the restructured contract he was discussing with the Denver Broncos, with whom he has spent his first six seasons, was not filed in time for the March 16 deadline, when his $12 million salary would have become guaranteed for 2013-14.
The three-time Pro Bowler has since fired his agent and received offers from the Broncos and Ravens, according to Klis.
Dumervil signed a six-year, $61.5-million contract with Denver in 2010 after posting a career-high 17 sacks, but missed the entire 2010 season due to injury. He has 20.5 sacks over the last two seasons, yet the Broncos were hesitant to pay a premium price for him.
The team's offer was worth $18 million over three years, Klis is reporting.
Though Denver converted him back into a defensive end, the position he played at Louisville, Dumervil will play outside linebacker across from Terrell Suggs in the Ravens' 3-4 defense.
This is the Super Bowl champions' first major addition of the offseason, after Baltimore lost key players in Ray Lewis, Ed Reed, Bernard Pollard, Paul Kruger and Anquan Boldin.