Spencer agreed to a one-year deal with the Cowboys on Saturday, his agent Jordan Woy tweeted.
Woy said Spencer's contract is worth up to $3.5 million. A source said the deal does not include a signing bonus but includes a $1.25 million base salary with per-game roster bonuses totaling $750,000. Spencer also has incentives worth $1.5 million.
Spencer played in only one game last year because of a knee injury that required microfracture surgery. The hope is that he will be healthy by the time training camp begins in late July. Spencer, the Cowboys' first-round pick in 2007, visited with the Washington Redskins and New York Giants earlier in free agency.
The Cowboys' offseason program began last Monday. Spencer has been rehabbing at the team's Valley Ranch facility.
The Cowboys are uncertain whether Spencer will be available for the beginning of training camp, a source told ESPNDallas.com.
Spencer had two tackles and two quarterback pressures in 34 snaps against the Kansas City Chiefs in Week 2 last season. He was slowed for much of training camp after having arthroscopic surgery on his knee. In 2012, Spencer had a career-high 11 sacks and was named to the Pro Bowl.
The Cowboys believed Spencer would be able to make the switch to defensive end without any problem when they moved to the 4-3 scheme. He is the fourth defensive linemen the Cowboys have signed this offseason, joining Henry Melton, Jeremy Mincey and Terrell McClain.
Even with those additions, the Cowboys could still take a defensive end or tackle with their first-round pick (No. 16 overall) in the upcoming draft.
This is the third straight one-year deal Spencer has had with the Cowboys. He made nearly $20 million in 2011 and 2012 as the team's franchise player.
ESPNDallas.com's Calvin Watkins contributed to this report.