MIAMI -- The Miami Dolphins showed again they can beat a bad team -- barely. Next comes the biggest game yet in the franchise's revival.
Rookie Dan Carpenter nailed a 38-yard field goal with 38 seconds left to cap a 61-yard drive, and the Dolphins earned their fourth consecutive victory Sunday by defeating woeful Oakland 17-15.
The Dolphins (6-4), who barely avoided a winless season in 2007, set up a showdown at home next Sunday against AFC East rival New England.
"This should be the first time I see our stadium sold out," linebacker Joey Porter said. "I've been here a year and a half and still haven't seen the place sold out. This matchup should definitely get us to that level."
Miami and New England trail the division-leading New York Jets by one game, but doubts remain as to whether the Dolphins belong in a playoff race. They beat injury-plagued Seattle by two points at home a week ago, and nearly blew Sunday's game after leading most of the way.
Johnnie Lee Higgins scored on a 93-yard punt return with 4:30 left to give the Raiders their first lead. Chad Pennington then moved the Dolphins down the field in 10 plays, completing a 7-yard pass on fourth-and-5 to Ted Ginn Jr. to keep the drive alive.
"It was my first fourth-and-5 with a minute or so left in the game," said Ginn, a second-year pro. "It was probably Chad's 20th. He's cool, calm and collected. He went out there and got the job done."
Oakland (2-8) lost its fourth in a row, and Tom Cable fell to 1-5 as interim coach.
"This is good for us," Cable said. "It hurts because we lost, but we're getting closer. We've just got to keep pounding away, and we'll get a break one of these days."
The Raiders generated only two field goals on offense, and scored when Jay Richardson sacked Pennington for a safety. They haven't registered an offensive touchdown in 13 quarters, and reinforcements failed to provide a spark.
Quarterback JaMarcus Russell returned after missing one game with a knee injury, and he went 15-for-22 for 156 yards, but Miami had six sacks. His last pass was a completion to the Oakland 30 before time ran out.
Teammate Darren McFadden, nursing a toe injury that has hampered him most of the season, played for the first time in four games as a reserve. He carried only three times for 13 yards, and the Raiders totaled just 70 yards on the ground.
"You can't have an offense that doesn't score points," running back Justin Fargas said. "We have to pick up our side of it."
Ginn had a 40-yard touchdown run on an end-around for the Dolphins. They ran for a season-high 222 yards, including 101 by Ronnie Brown in 16 carries.
The Raiders went 2-for-11 on third-down conversations and were outgained 382-186. Still, they nearly pulled out a win thanks to Higgins.
The Dolphins' punt coverage unit ranks second worst in the NFL, and he found a gaping crease. The closest would-be tackler was the last line of defense, punter Brandon Fields, who slapped Higgins' heel in an unsuccessful diving attempt to prevent the score that put Oakland ahead 15-14.
"We keep putting ourselves in these dogfights," Porter said. "You don't want them to come back and bite you. When you've got a team down, you've got to figure out how to put them away. Having last-second wins is not something you want to be hoping for every time."
The Dolphins drove 93 yards on their opening possession and scored on the run by Ginn, who broke one tackle and juked past another defender. Their other touchdown drive covered 64 yards in the third period and was capped by Patrick Cobbs' 10-yard run for a 14-5 lead.
The Raiders drove 75 yards late in the first half, but with first-and-goal at the 5, they committed two penalties, lost 5 yards on a broken play and settled for a field goal and a 7-3 halftime deficit.
Sebastian Janikowski had a chance to give Oakland an 8-7 lead in the third quarter, but his 46-yard field goal attempt deflected off the right upright.
Russell was informed after the game of a death in his family, the Raiders said. He didn't talk to reporters. ... Ginn's touchdown rushing was the first by a Dolphins receiver since 2003. ... For the fourth consecutive game, Miami had the ball for more than 10 minutes in the fourth quarter. ... Shane Lechler continues to be one of Oakland's few bright spots. He averaged 52.7 yards on six kicks, four inside the 20.