John Harbaugh went for the win. The gamble cost the Baltimore Ravens and kept the Pittsburgh Steelers in the mix in the AFC North.

Pittsburgh topped Baltimore 20-19 on Sunday, thwarting a 2-point conversion attempt after Lamar Jackson's touchdown pass to Sammy Watkins got the Ravens within one with 12 seconds to go.

Rather than turn to star kicker Justin Tucker for an almost automatic 35-yard extra point, the Ravens (8-4) went for the knockout punch. Baltimore tight end Mark Andrews couldn't haul in a flip by Jackson. The Steelers (6-5-1) recovered an onside kick to seal it.

Pittsburgh Steelers free safety Minkah Fitzpatrick (39) celebrates after he intercepted a pass to Baltimore Ravens tight end Mark Andrews (89) during the first half of an NFL football game, Sunday, Dec. 5, 2021, in Pittsburgh. (AP PhotoGene J. Puskar)

Pittsburgh Steelers free safety Minkah Fitzpatrick (39) celebrates after he intercepted a pass to Baltimore Ravens tight end Mark Andrews (89) during the first half of an NFL football game, Sunday, Dec. 5, 2021, in Pittsburgh. (AP PhotoGene J. Puskar)

Pittsburgh ended a three-game winless streak behind the 39th fourth-quarter comeback engineered by Ben Roethlisberger.

The 39-year-old quarterback threw for 236 yards and two second-half touchdowns to Diontae Johnson, the final one a 5-yard catch-and-run with 1:48 to play that gave the Steelers a 20-13 lead.

It was enough. Barely.

Baltimore Ravens quarterback Lamar Jackson (8) passes against the Pittsburgh Steelers during the first half of an NFL football game, Sunday, Dec. 5, 2021, in Pittsburgh. (AP PhotoDon Wright)

Baltimore Ravens quarterback Lamar Jackson (8) passes against the Pittsburgh Steelers during the first half of an NFL football game, Sunday, Dec. 5, 2021, in Pittsburgh. (AP PhotoDon Wright)

Jackson took the Ravens 60 yards in eight plays, the last six coming on a tumbling grab by Watkins in the back of the end zone. The offense stayed on the field for the 2-point conversion, opting to do it even after a surprised Pittsburgh called timeout to reset.

The Steelers brought pressure on Jackson — a constant for three-plus hours — and his hurried throw was too far out in front for Andrews to bring it in.

Jackson passed for 253 yards with the touchdown and an interception in the end zone in the first quarter. He added a team-high 55 yards rushing, but also absorbed seven sacks, including 3 1/2 by star outside linebacker T.J. Watt after he did not practice during the week after being placed on the COVID-19 list.

Baltimore Ravens running back Devonta Freeman (33) goes over Pittsburgh Steelers free safety Minkah Fitzpatrick (39) to score a touchdown during the first half of an NFL football game, Sunday, Dec. 5, 2021, in Pittsburgh. (AP PhotoGene J. Puskar)

Baltimore Ravens running back Devonta Freeman (33) goes over Pittsburgh Steelers free safety Minkah Fitzpatrick (39) to score a touchdown during the first half of an NFL football game, Sunday, Dec. 5, 2021, in Pittsburgh. (AP PhotoGene J. Puskar)

A day after ESPN — using anonymous sources — reported that Roethlisberger was telling some on the team it may be his final season, he fought off a sluggish first half to add one more chapter in his long history with the Ravens.

A 29-yard throw to a wide-open Johnson pulled Pittsburgh within 10-9 early in the fourth and after the teams traded field goals, he gave the Steelers their first lead when he hit an open Johnson to finish an 11-play, 69-yard drive.

Johnson atoned for a rare drop in the first half that would have resulted in a touchdown by finishing with eight receptions for 105 yards and the two scores.

Baltimore Ravens running back Devonta Freeman (33) scores a touchdown in front of Pittsburgh Steelers safety Terrell Edmunds (34) during the first half of an NFL football game, Sunday, Dec. 5, 2021, in Pittsburgh. (AP PhotoGene J. Puskar)

Baltimore Ravens running back Devonta Freeman (33) scores a touchdown in front of Pittsburgh Steelers safety Terrell Edmunds (34) during the first half of an NFL football game, Sunday, Dec. 5, 2021, in Pittsburgh. (AP PhotoGene J. Puskar)

The Ravens dominated the first half — including a 99-yard drive that chewed up more than 10 minutes — but only had a 7-3 lead to show for it.

The Steelers hung in there behind a defense that failed to let Jackson get comfortable, buying enough time for Roethlisberger to summon a little bit of the magic that's defined the vast majority of his stellar career.

INJURIES

Ravens: OL Patrick Mekari left in the second half with a hand injury and did not return.

Steelers: G B.J. Finney left in the first quarter with a back injury. Finney was replaced by John Leglue, who made his NFL debut.

Field judge Mike Weatherford left early in the fourth quarter after getting tangled up with Chase Claypool following a 40-yard gain.

UP NEXT

Ravens: Go for a season sweep of the Browns when they travel to Cleveland next Sunday. Baltimore took the first meeting 16-10 last week.

Steelers: Face a short week with a visit to Minnesota scheduled for Thursday night.

More AP NFL coverage: https://apnews.com/hub/nfl and https://twitter.com/AP_NFL