MIAMI GARDENS, Fla. (AP) -- Derek Carr threw for 300 yards and the Oakland Raiders overcame two fluky plays that cost them possession to beat the Miami Dolphins 27-24 on Sunday night.

Carr went 21 of 30 with one touchdown and one interception. He helped the Raiders convert 8 for 15 third downs.

The Dolphins recovered an onside kick and came up with a takeaway when Oakland fumbled twice on a single play, but failed to convert either opportunity into points. Oakland also overcame 10 penalties for 105 yards, including three for unnecessary roughness in the second quarter.

The Raiders' Marshawn Lynch, returning from one-game suspension for shoving an official, scored on a 22-yard run, his longest this year. He added another late score and finished with 57 yards on 14 carries.

Oakland (4-5) won for only the second time since Week 2. Miami (4-4) fell to .500 for the third time this season, and lost a close game for the first time in more than a year. In games decided by seven points or less, they had won 12 in a row.

Miami's Jay Cutler, back after missing one game with cracked ribs, completed his first 16 passes and finished 34 for 42 for 311 yards and three scores. His touchdown pass with 1:32 left cut the deficit to three points, but Oakland recovered the ensuing onside kick to seal the win.

The Dolphins' worst-in-the-NFL offense again struggled to the run the ball in its first game since trading running back Jay Ajayi. Replacement Kenyan Drake had a 42-yard run -- Miami's longest this year -- to set up a touchdown, but the Dolphins totaled just 86 yards rushing and still don't have a rushing touchdown this season.

SURPRISE TARGET

The Raiders' Johnny Holton outmaneuvered Reshad Jones in the end zone for a 44-yard touchdown reception. Holton's celebratory dance was impressive, too -- he clasped his hands between his knees and hopped along the sideline.

His only other catch this season was for a 64-yard score.

Carr's favorite target was tight end Jared Cook, who had eight catches for 126 yards.

BEAT THE CLOCK

Carr moved the Raiders 42 yards in the final 26 seconds of the first half before Giorgio Tavecchio kicked a 53-yard field goal, the longest of his career, on the final play to put Oakland up 13-9 at halftime.

MIXED BAG

The Dolphins' Cody Parkey missed an extra point but recovered his own onside kick. Miami failed to take advantage, with Kenyan Drake losing a fumble at the 20. Parkey also made a tackle on a kickoff.

HOT POTATO

Oakland fumbled twice on one play. When Carr was hit by Ndamukong Suh and coughed up the ball, 330-pound tackle Marshall Newhouse scooped it up and took off. He also fumbled when hit, and Miami's Charles Harris recovered.

INJURIES

Miami right tackle Ja'Wuan James went to the locker room midway through the fourth quarter with a left hamstring injury.

UP NEXT

The Dolphins play their third prime time game in a row when they're at Carolina (6-3) on Monday, Nov. 13.

The Raiders travel to Mexico City to face AFC East leader New England (6-2) next Sunday.