The trade cannot officially be processed until the new league year begins March 13.
The teams are prohibited from commenting on the deal or the terms. When the deal is completed, it likely will be for a midround pick, sources told ESPN.
The agreement means that Baltimore is officially committing to Lamar Jackson as its quarterback. When the deal is completed, the Ravens will save $10.5 million in cap space. However, they will carry $16 million in dead money on their 2019 cap.
Meanwhile, the Broncos, who have the 10th overall pick in this year's draft, are addressing their biggest need as the NFL's offseason quarterback carousel is beginning to spin.
Trade talks between Baltimore and Denver commenced Monday and culminated Wednesday morning, when the Broncos agreed to the deal for Flacco, the MVP of Super Bowl XLVII.
This trade is the first domino to fall this offseason, with other quarterbacks such as Nick Foles, Ryan Tannehill, Tyrod Taylor and Blake Bortles expected to change teams. The Jacksonville Jaguars, Washington Redskins and Miami Dolphins are among the teams expected to add new quarterbacks.
The demand at the position is one reason Denver pounced on Flacco. The Broncos began to study him during Super Bowl week, sources told ESPN, and agreed to a deal before the combine.
Flacco, 34, has no more guaranteed money on his contract. His contract carries base salaries of $18.5 million for 2019, $20.25 million in 2020 and $24.25 million in 2021.
New Broncos coach Vic Fangio was in Baltimore for Flacco's first two seasons, so he knows what he'll be getting. Former Broncos executive Gary Kubiak also was a noted Flacco fan, and his opinions were a strong starting point to selling Denver on the deal.
The trade means the Broncos are moving on from quarterback Case Keenum, who started for the team last season after signing a two-year, $36 million contract in free agency. He is due $18 million in 2019, with just $7 million guaranteed. The Broncos will carry $10 million in dead money if they cut him.
Keenum tied for the second-most interceptions in the league this past season with 15, and his 6.6 yards per attempt was 29th.
This marks the first trade for new Ravens general manager Eric DeCosta, who replaced Ozzie Newsome at the conclusion of last season.
Whatever the compensation turns out to be, Flacco will be playing in Denver, where he had a huge role in the "Mile High Miracle" in January 2013 -- a 70-yard touchdown pass to Jacoby Jones that sent an AFC divisional playoff game into overtime. The Ravens went on to win the game in double overtime, followed by victories in the AFC Championship Game and the Super Bowl.
Broncos executive John Elway has consistently said since season's end that he would consider any and all options to repair the team's quarterback struggles. The Broncos used four different starting quarterbacks over the last two seasons and cut Paxton Lynch, their first-round pick in 2016, last summer.
ESPN's Jeff Legwold contributed to this report.