Stafford rallied from two early interceptions to complete 28-of-36 passes for 335 yards in Detroit's (7-3) second win in three games.
"We really moved the ball well in the first half. We just killed ourselves with turnovers," Stafford said. "I just knew if we could keep the ball in our hands on those drives in the second half we could get some points."
Kevin Smith, who was signed on November 11 after running back Jahvid Best suffered a concussion, ran for a career-high 140 yards with two touchdowns and added 61 yards and a score on four receptions for the Lions.
Cam Newton went 22-for-38 through the air for 280 yards and a touchdown, but also threw four interceptions for Carolina (2-8).
The No. 1 overall pick in the draft also recorded 37 yards and two touchdowns on the ground, giving him nine rushing touchdowns for the season and breaking Vince Young's prior rookie record of seven.
Holding a 27-14 lead, the Panthers were forced to punt from their own 28 on the opening drive of the second half. Stefan Logan returned the kick 16 yards and a horse-collar penalty tacked on 15 more yards, placing the ball at the Carolina 30.
The Panthers gained just six yards on their next possession -- five on a penalty -- and gave the ball back to Detroit.
Calvin Johnson hauled in a 26-yard grab to move the Lions past midfield and Stafford hit Tony Scheffler on a post for a 17-yard touchdown on 3rd-and-12 to put Detroit ahead, 28-27, for the first time in the game.
Smith's four-yard touchdown with 8:02 left in the fourth quarter gave the Lions a little cushion, but Carolina fought back on the ensuing drive.
Jonathan Stewart turned a short pass into a 26-yard gain on the second play of the drive and Williams did the same to move the ball 32 more yards three plays later.
On 1st-and-goal at the six, Newton took the snap and instantly pushed forward for a score. Steve Smith converted the two-point try with a grab on the left side of the end zone to tie the game at 35 with 4:59 to go.
But Stafford found Johnson for a 30-yard leaping catch to start Detroit's next possession before hitting Brandon Pettigrew between two defenders for the go- ahead seven-yard touchdown.
Newton stepped under center with a chance to tie the game, but threw a bullet down the middle on the first play of the Panthers' drive that was deflected right to Detroit's Chris Harris at the Carolina 23.
Kevin Smith then put the game away with a 19-yard rush into the end zone.
"We played the way you would like to in the first half but this game is four quarters," Panthers head coach Ron Rivera said.
The first three possessions of the game resulted in three interceptions -- two by Stafford and one by Newton -- with Stafford's second resulting in an Olindo Mare 27-yard field goal.
The Lions' early offensive woes continued on their third possession as Keiland Williams fumbled deep inside Detroit territory and Carolina recovered at the Lions 29.
Newton again made the Lions pay by hitting Steve Smith for a 15-yard score to give the Panthers a 10-0 lead.
Detroit finally found its stride on the ensuing drive, needing just three plays to find the end zone. Kevin Smith ripped off a 43-yard run before Stafford found him for a 28-yard score on a screen less than a minute into the second quarter.
But Carolina quickly answered that TD with a 101-yard kickoff return by Kealoha Pilares. The return set a new franchise record as he ran untouched down the left sideline.
After a Lions three-and-out, the Panthers started a drive at the Detroit 48 and Newton capped the five-play march with an 11-yard scramble for a touchdown to give Carolina a 24-7 lead.
Detroit made it a 10-point game again on the next touch. Stafford converted two third downs through the air on the 12-play drive before Young hauled in a three-yard TD pass.
Mare split the uprights from 31 yards out as time expired to give Carolina a 27-14 advantage at the half.