DETROIT — Calvin Johnson thought Matthew Stafford was going to spike the ball for at least another snap.
The Dallas Cowboys did, too.
Stafford’s 1-yard lunge over a pile of linemen with 12 seconds left and Johnson’s 329 yards receiving lifted the Detroit Lions to a 31-30 win over Dallas on Sunday.
‘‘I was yelling that I was going to spike the ball,’’ Stafford recalled. ‘‘But their linebackers were just standing there.’’
The Cowboys weren’t just standing around letting Johnson make catch after catch, but he made them look helpless.
Johnson almost broke an NFL record, and could celebrate the feat because of a comeback from a 10-point, fourth-quarter deficit that some people who entered Ford Field didn’t see because they had left.
‘‘Even our fans didn’t think we could pull this one out,’’ he said. ‘‘They were leaving, but we knew we could do it.’’
Johnson’s total trails only the 336 yards receiving Flipper Anderson had for the Los Angeles Rams against New Orleans on Nov. 26, 1989 in a game that went into overtime. Anderson had 296 yards receiving in regulation.
The Cowboys dared Detroit to throw to Johnson with a lot of one-on-one coverage.
They usually asked cornerback Brandon Carr to do the improbable by defending him by himself, and sometimes attempted to slow him down with a zone.
‘‘He had his way,’’ Carr said. ‘‘And, we couldn’t find a way to keep him from rolling.’’
‘‘It was crazy,’’ he said. ‘‘We had a lot of one-on-one coverage today, and we were able to take advantage and hit some deep balls. Matt made some great throws to me.’’
The Lions (5-3) overcame four turnovers without forcing a turnover, becoming the first team to do that and win since the Patriots did it against Miami in 2007, according to STATS. Detroit outgained Dallas, 623-268.
On the Lions’ last drive, Stafford threw a 22-yard pass to Johnson to set up the winning score. The quarterback caught at least some Cowboys by surprise, including linebacker Sean Lee, who appeared to expect him to spike the ball to stop the clock.
‘‘He kind of caught us off-guard,’’ defensive tackle Jason Hatcher acknowledged.
Dallas (4-4) seemed to set itself up to win three straight for the first time this year to build a bigger lead atop the NFC East when Tony Romo connected with Dez Bryant on a touchdown pass for the second time, good for a 27-17 lead with 6:45 left.
The Cowboys, though, allowed Reggie Bush to cap an 80-yard drive with a 1-yard TD run with 3:33 left. They also had to settle for Dan Bailey’s third field goal with 1:02 left after Tyron Smith was flagged for holding on third down, a mistake that stopped the clock even though Detroit declined the penalty.
‘‘If we don’t get called for a penalty, I think they probably had 20 seconds or so left,’’ Romo said.
With no timeouts, the Lions went from their 20 to the Cowboys’ end zone thanks in large part to a 17-yard pass to Johnson, a 40-yard connection with Kris Durham, and Johnson’s 14th reception that gave them the ball at the Dallas 1.
Instead of spiking the ball, Stafford took the snap and leaped with his arms extended to beat the team he rooted for growing up in Highland Park, Texas.
Stafford was 33 of 48 for 488 yards —his second-highest total — with a 2-yard TD pass to Johnson in the first quarter and two interceptions. Bush had 92 yards rushing and a score.
Romo was 14 of 30 for 206 yards without a turnover.