The star defensive end's agreement with Baltimore was earlier reported by the Denver Post.
Dumervil became a free agent earlier this month after he was released by the Denver Broncos when paperwork for his reworked contract didn't make it in time to the team. He had agreed to reduce his salary from $12 million to $8 million for next season.
The Broncos had made another offer to re-sign Dumervil after his release.
Dumervil signed a six-year, $61.5 million contract in 2010. He had 11 sacks last season, second on the team behind Von Miller. Dumervil led the league with 17 sacks in 2009.
He becomes a welcome addition to the Ravens, who have seen numerous key contributors to their Super Bowl victory leave this offseason.