EAST RUTHERFORD, N.J. -- The New York Jets faced the possibility of a stinging loss that would have knocked them out of first place in the AFC East and severely damaged their playoff hopes.
A bad play call, a big hit and a lucky bounce changed all that in an instant.
Abram Elam sacked Buffalo Bills quarterback J.P. Losman from behind and caused a fumble, and Shaun Ellis picked up the ball and rumbled 11 yards into the end zone with 1:54 left to give the Jets the go-ahead touchdown in a 31-27 victory Sunday.
"That play that Shaun makes and Abe makes, who knows?" Jets quarterback Brett Favre said. "At the end, we may look back and say that could be one of those plays that catapulted us into something great."
Maybe, but the Jets (9-5) looked nothing like a playoff team for most of this game as the Bills' once-dormant offense prospered against New York's struggling defense.
Buffalo (6-8) was nursing a 27-24 lead and close to wrapping up its first win against an AFC East opponent this season when Losman dropped back to throw and was hit by a blitzing Elam. The ball squirted out and bounced around before Ellis grabbed it, tiptoed down the sideline and splashed into the end zone for a touchdown.
"I just kept running, got some good blocking and was able to get into the end zone," Ellis said.
Added running back Thomas Jones: "Me and Laveranues (Coles) said he jumped into the end zone like he was jumping in the pool."
The big play came as Ellis is dealing with legal troubles. He was arrested Nov. 29 and charged with possession of marijuana, speeding and driving without insurance after being pulled over by police in Hanover, N.J.
"Shaun has been Shaun, he hasn't changed," Favre said. "You find out a lot about people in tough times. If anything, guys rallied around him. It was good for this team that that play happened. And it was good for Shaun."
The Jets were surprised the Bills were passing in that situation, expecting Buffalo to try to run out the clock. After all, Marshawn Lynch gained 127 yards on 21 carries and New York was struggling to stop him. Instead, Buffalo coach Dick Jauron overruled offensive coordinator Turk Schonert and called for the throw.
"Clearly the responsibility for the last call, the play-action pass, that was mine," Jauron said. "That goes right on me. It backfired clearly and caused us to lose the game. ... It's one of those times in a game that's pretty good for a pass, right before the two-minute (warning)."
Jauron refused to blame Losman, who made his second straight start for the injured Trent Edwards.
"It's on my shoulders to protect him, to keep him from that situation," Jauron said, "and I didn't do it."
It was a hectic scene as bodies flew everywhere near the end zone, with even referee Jeff Triplette getting knocked to the turf face first by Bills center Duke Preston and taking a bloody nose. Triplette worked the rest of the game while wiping his face with a towel.
Buffalo got the ball back twice, but both drives ended on interceptions, including Losman's desperation heave that was picked off in the end zone by Kerry Rhodes as time expired.
"It's been that type of season," Bills wide receiver Lee Evans said. "Sometimes the ball bounces funny ways. On that last play, it certainly took a bounce for the worst for us."
The Jets remained tied atop the division with the Miami Dolphins, who beat the San Francisco 49ers 14-9, and the New England Patriots, who routed the Oakland Raiders 49-26.
It didn't appear likely that the Jets would be doing any celebrating after this game, especially when the Bills -- held to single field goals in their previous two games -- went ahead on Fred Jackson's 11-yard touchdown run with 5:30 remaining.
Losman marched the Bills down the field with four straight completions to get the ball to the Jets' 20. Lynch followed with a 9-yard run, and then Jackson powered into the end zone despite being hit by several Jets defenders at the 3.
The Jets snapped a two-game losing streak and offset another shaky performance by Favre. The veteran quarterback was 17-of-30 passing for 207 yards and one touchdown, but he also threw two interceptions and misfired several times.
"Maybe I don't have the arm I once had," he said. "I don't know."
Losman was 24-of-39 passing for 148 yards and one score and was picked off three times.
Leon Washington gave the Jets a 21-17 lead on a 47-yard touchdown run with less than one minute left before halftime.
The Jets took a 7-0 lead on Jones' 2-yard touchdown run on their first possession. It was the eighth straight game in which he scored, and it was his 15th touchdown overall and 13th rushing -- all franchise records.
Notes: Jones, who entered the game leading the AFC with 1,144 rushing yards, finished with 78 yards on 20 carries. ... Jets linebacker Vernon Gholston, the No. 6 overall pick, was inactive for the first time. ... Jets safety Eric Smith played for the first time in seven weeks after suffering three head injuries in four games. ... Bills rookie wide receiver James Hardy left early in the first quarter with an injured left knee and didn't return. Jauron was unsure of the severity of the injury but said, "We'll have to remain optimistic."
Copyright 2008 by The Associated Press.