Stafford and the Lions agreed on a six-year contract, agent Tom Condon said on Friday night. Condon and Ben Dogra, who also represents Stafford, negotiated the deal with $41.7 million in guarantees and a maximum value of $78 million.
The Lions will formally take Stafford with the No. 1 pick in the draft Saturday.
They have five of the first 82 picks to help the NFL's first 0-16 team bounce back to respectability.
Detroit hasn't had a quarterback play in the Pro Bowl since Greg Landry in 1971. Long-term stability at the position has been elusive since Bobby Layne starred for them in the 1950s.
Just before first-year coach Jim Schwartz was hired last winter, he joked that it was about time to replace Layne. In a coincidence, Stafford and Layne both played at Highland Park High School in Dallas.
The Lions' lack of star power at QB is a major reason why the franchise has only one playoff victory since winning the 1957 NFL title.
The Lions desperately need talent under center to help turn around a franchise that is languishing in what has become the worst eight-year stretch in the league since World War II.
They are turning to Stafford, who was a starter in each of his three seasons at Georgia.
Detroit might be able to help Stafford's chances to succeed by letting him watch Daunte Culpepper play initially next season.
But there will be pressure to get him on the field because of its investment.
In guarantees and maximum value, his contract is more lucrative than the one signed by the first QB taken last year.
Matt Ryan, the No. 3 pick in 2008, got $72 million with $34.75 million guaranteed as part of six-year contract with the Atlanta Falcons.
Detroit general manager Martin Mayhew said earlier in the week the chances were "very good" an agreement would be reached with the No. 1 pick before Saturday.
On the eve of the draft, the deal was done.
Stafford always seemed to be Plan A, but Wake Forest linebacker Aaron Curry and Baylor offensive tackle Jason Smith apparently were backup options.
Stafford will not be able to fix all the problems associated with a franchise that has been bad enough to go 31-97 since 2001 in what has been the worst eight-year stretch by an NFL team since the Chicago Cardinals won 23 percent of their games from 1936-43.
But the Lions can't afford to draft another bust as they did with quarterback Joey Harrington, who they took No. 3 overall in 2002. Harrington was traded after four lackluster seasons to Miami for a fifth-round pick. The Dolphins later cut him, Atlanta added him and got rid of him and he is now a third-stringer in New Orleans.
"Obviously, the draft is the biggest crap shoot there is," Stafford recently acknowledged.
Recent No. 1 picks have proven that.
Eight of the past 11 players taken first overall in the NFL have been QBs, and half of them either haven't or didn't pan out for the teams that took them.
For every Peyton Manning and Carson Palmer, guys like Tim Couch and David Carr have shown there are no guarantees.