Dallas acquired Cassel and Buffalo's 2017 seventh-round draft pick for Dallas' fifth in 2017, sources said.
The Cowboys plan to startBrandon Weedenin Romo's absence with Cassel installed as a backup.
Against the visitingAtlanta Falconsin Week 3, Kellen Moore will be the No. 2 quarterback, with Cassel No. 3, a source told ESPN.
But Cassel is expected to supplant Moore as the No. 2 once he has time to learn the system and teammates, the source said.
Cassel, 33, served as the Bills' backup to Tyrod Taylor for the first two games of the season. Cassel, Taylor and EJ Manuel were part of a three-way competition for the starting job during training camp and the preseason.
The Bills released Cassel during final cuts in early September but re-signed him three days later after Cassel agreed to take more than a 50 percent pay cut.
The next game Romo is eligible to start is Nov. 22 atMiamiafter the Cowboys placed him on the injured reserve/designated to return list Tuesday.
The move keeps him out for the next eight weeks as he recovers from a broken left collarbone. Romo will not have surgery.
The Cowboys worked out Matt Flynn, McLeod Bethel-Thompson, Josh Johnson and Christian Ponder on Tuesday and were looking at adding Flynn or Bethel-Thompson before the trade for Cassel materialized.
Cassel won a division championship as the Kansas City Chiefs' starter in 2010, and helped the New England Patriots win 10 games in 2008 afterTom Brady suffered a season-ending knee injury in their opener.
Cassel is due $2 million in base salary this season and can earn up to an additional $2.15 million in playing-time and playoff incentives.
Cassel, whom the Bills acquired in trade from the Minnesota Vikings in March, played just four possessions this preseason, completing 13 of 15 passes for 83 yards.
Information from ESPN Staff Writers Todd Archer, Ed Werder and Mike Rodak was used in this report.
Is Cassel the best option for Dallas?
Ed Werder discusses the other quarterbacks the Cowboys considered bringing in besides Matt Cassel, and whether Cassel could start if Brandon Weeden struggles.
Cowboys trade for Matt Cassel
ESPN NFL reporter Ed Werder reacts to the news that the Cowboys have traded with the Bills for veteran QB Matt Cassel.