Per Mike Klis of 9News, the Broncos ultimately went with Flacco after "kicking the tires" on Foles because his experience playing under center fits better with offensive coordinator Rich Scangarello's system.
ESPN.com's Adam Schefter reported the Ravens and Broncos agreed to a deal for Flacco that can't become official until the new league year begins on March 13.
Klis added Flacco's contract, which pays him $18.5 million in 2019, is a better value for the Broncos than the possibility of Foles getting in excess of $25 million.
Per NFL Network's Ian Rapoport, Denver will attempt to trade Case Keenum after signing him to a two-year deal last March.
The Broncos projected to have $37.3 million in cap space before factoring in Flacco's salary, per OverTheCap.com.
Flacco will attempt to rebuild his value after losing his starting job to Lamar Jackson in Baltimore last season. The 34-year-old went 4-5 with 2,465 yards, 12 touchdowns and six interceptions in nine starts before a hip injury knocked him out of action.