OAKLAND, Calif. (AP) — Joe Flacco hit Mike Wallace on two deep passes to spark Baltimore’s struggling offense, and the Ravens got a fumble return for a touchdown by Jimmy Smith to beat the short-handed Oakland Raiders 30-17 on Sunday.

Flacco had struggled to get the ball downfield in losing the past two weeks. He changed that on the opening drive of the game for the Ravens (3-2) when he connected on a 52-yard pass to Wallace that set up an early touchdown and established the tone for the day.

The Raiders (2-3), playing without injured star quarterback Derek Carr and two key cornerbacks, played from behind all game as Smith returned Jared Cook’s fumble 47 yards for a touchdown that made it 14-0 just 3:50 in.

But that wasn’t nearly enough for the Raiders, who have dropped three straight following a 2-0 start, putting a severe dent in their hopes to challenge in the AFC West.

The Ravens had also lost two in a row following a 2-0 start, but reversed that slide thanks to Flacco and the opportunistic defense. Flacco completed 19 of 26 passes for 222 yards.

KEY DRIVE

The Coliseum was rocking after Lynch’s TD cut Baltimore’s lead to 24-17 late in the third quarter. The Ravens, who had been held to three-and-outs the first two drives of the second half, responded with a 72-yard drive to a 21-yard field goal by Justin Tucker that gave Baltimore a 10-point lead. Flacco converted a pair of third downs on the drive, completing a 13-yard pass to Breshad Perriman on third-and-3, and a 27-yarder to Wallace on third-and-8.

QUESTIONABLE DECISION

The Raiders drove into Baltimore territory on the next drive and faced fourth-and-3 from the Ravens 44 with about nine minutes left. Coach Jack Del Rio opted to punt despite the 10-point deficit, and Marquette King sent it into the end zone for a touchback. Baltimore then drove 64 yards in 6:26 to take a 13-point lead.

GOING DEEP

The Ravens had only three pass plays of at least 20 yards the first four games, including none the past two weeks. Flacco and Wallace connected on three: the 52-yarder on the first drive, a 54-yarder to set up a field goal in the second quarter, and the 27-yarder on third down in the third quarter.

GET BACK UP AGAIN

Flacco showed off his improvisational skills in the first quarter when he tripped on a drop back after a shotgun snap. He got up and stumbled before getting off a 6-yard pass to Jeremy Maclin that converted a third down. The Ravens ended up scoring on the drive on a 1-yard run by Javorius Allen that made it 21-3.

INJURIES

Ravens RB Terrance West departed on the opening drive with a left calf injury following a 13-yard run. He did not return. … Raiders LB Marquel Lee was taken off on a cart after injuring his right ankle in the fourth quarter.