ORCHARD PARK, N.Y. — Trent Edwards and the Buffalo Bills overcame a sloppy start to produce a second straight fourth-quarter comeback victory.

Rian Lindell hit a 38-yard field goal as the clock ran out, capping a 24-23 win over the Oakland Raiders on Sunday. Edwards engineered three scoring drives in the final quarter, helping the Bills twice overcome 9-point deficits in the last 8 minutes.

Edwards finished 24-of-39 for 279 yards and a touchdown a week after he rallied the Bills to a 20-16 win at Jacksonville.

That the victory came against the hard-luck and dysfunctional Raiders (1-2) didn't matter for a Bills team that is off to its first 3-0 start since 1992.

The defeat spells trouble for Raiders coach Lane Kiffin, who is on the hot seat after Oakland opened the season with a 41-14 loss to Denver. Kiffin got a reprieve after a 23-8 win at Kansas City last weekend.

Kiffin waited a split second too late to call timeout in an attempt to freeze Lindell before the Bills snapped the ball. Kiffin was spotted on the sideline attempting to call timeout and then watching Lindell's kick split the uprights.

It was a dramatic turn of events for the Raiders, who appeared to have the game in hand when JaMarcus Russell — on third-and-10 — hit Johnnie Lee Higgins on a skinny post for an 84-yard touchdown to put Oakland ahead 23-14 with 6:23 left.

Back marched the Bills.

For the fourth time in 12 career starts, Edwards led them to victory when they were behind or tied in the fourth quarter. He went 4-of-6 for 65 yards, including an 11-yard touchdown pass to Roscoe Parrish, to cap a seven-play, 69-yard drive.

After the Raiders went three-and-out, the Bills took over at their 34 with 2:29 left.

Edwards hit Josh Reed for an 11-yard reception and hit Parrish for a 16-yarder on the first two plays. The Bills then caught the Raiders defense napping when Marshawn Lynch carried the ball four times for 21 yards to all but run out the clock and set up Lindell's field goal.

Lindell made up for missing a 46-yard attempt wide right in the third quarter. Lynch finished with 83 yards and two touchdowns.

It was a disappointing finish for a Raiders team that appeared ready to win consecutive road games to start the season for the first time since 2000.

Russell finished 9-of-19 for 156 yards and also scored on a 1-yard plunge. Sebastian Janikwoski hit three field goals.

The Raiders running game, which produced 300 yards against Kansas City last weekend, was limited to 98 yards.

The Bills were hampered through three quarters by poor field position, having five drives start inside their 20.

Lynch's first score came after defensive end Chris Kelsay punched the ball out of Russell's hand, allowing Paul Posluszny to recover it at the Raiders 23.