The Pittsburgh Steelers are heading to Denver. The Cincinnati Bengals are heading to another long offseason after a meltdown as ugly and ill-timed as it was complete.

Chris Boswell kicked a 35-yard field goal with 14 seconds remaining as the Steelers somehow pulled out an 18-16 victory in the AFC wild-card game Saturday night.

Pittsburgh (11-6) moved into field goal position after a pair of 15-yard penalties on the Bengals, one on linebacker Vontaze Burfict and another on Adam Jones after Burfict hit defenseless Steelers wide receiver Antonio Brown. Boswell drilled his fourth field goal of the game to give the Steelers their first playoff win since the 2010 AFC championship game.

The Bengals appeared to be in position for their first postseason win in 25 years before Jeremy Hill's fumble gave Pittsburgh one last shot.

Roethlisberger left with a right shoulder injury on the final play of the third quarter but returned for Pittsburgh's last-gasp drive. Unable to throw with any real authority, he still managed to get the Steelers near midfield with 22 seconds to go when he threw high to Brown in Cincinnati territory.

Burfict, whose sack of Roethlisberger sent the quarterback to the locker room, lowered his shoulder as Brown landed. The volatile linebacker earned a personal foul. Jones compounded the problem when he lost his cool, easily putting Boswell within field goal range after Cincinnati's eighth — and final — flag of an unsightly night.

Roethlisberger finished 18 of 31 for 229 yards and a touchdown in rainy conditions. Jordan Todman and Fitzgerald Toussaint combined for 123 yards rushing filling in for DeAngelo Williams.

Still, it hardly seemed like it would be enough. AJ McCarron put together a late rally after Martavis Bryant's somersaulting touchdown grab gave the Steelers a 15-0 lead heading into the final quarter.

Cincinnati (12-5) ripped off 16 straight points, the last six on a 25-yard strike from McCarron to A.J. Green that put the Bengals in front. They missed the 2-point conversion.

When Burfict intercepted Landry Jones on Pittsburgh's ensuing possession, Cincinnati and coach Marvin Lewis appeared ready to end the sixth-longest postseason drought in NFL history.

Then, the team that said it would keep it together fell completely apart.

Hill saw the ball pop out as Cincinnati tried to run out the clock and the Steelers recovered at the Pittsburgh 9 with 1:23 left. Just enough time for Roethlisberger — with plenty of help from Cincinnati — to send the Steelers to Denver and a rematch with the Broncos, whom Pittsburgh beat 34-27 on Dec. 20.

Another long winter looms in Cincinnati.

The Bengals controlled the AFC North, easily winning their fourth division title under Marvin Lewis even with QB Andy Dalton breaking his right thumb during a loss to Pittsburgh on Dec. 13. Yet all a dozen wins did was set them up for a third showdown with their longtime tormentor in an increasingly acidic rivalry.

Pittsburgh survived a bumpy four months that included significant injuries to Roethlisberger, running back Le'Veon Bell, center Maurkice Pouncey and left tackle Kelvin Beachum. The Steelers needed a win in Cleveland and a Buffalo upset of the Jets on the final Sunday to make the playoffs for a second straight year.

A trip to Cincinnati hardly seemed a problem: The Steelers have lost in Paul Brown Stadium only three times since it opened in 2000, a sea of Terrible Towels turning the Bengals' home into Heinz Field West. It served as the launching point of a Super Bowl run in 2005.

Both teams pledged to be on their best behavior with so much at stake, and for a while tempers were kept largely in check. There were no pregame fisticuffs this time — unlike Pittsburgh's previous visit — thanks in part to assistant coaches on both sides creating a black-clad DMZ at midfield.

The first personal foul penalty came from an unlikely source, Pittsburgh Hall of Fame offensive line coach Mike Munchak, flagged for grabbing Reggie Nelson's hair after the safety found himself mixing it up with a couple of Steelers after pushing Todman out of bounds.

McCarron, so effective while replacing Dalton, could do little. The Bengals managed just 56 yards of total offense yet trailed just 6-0 as the Steelers and the league's third-ranked offense could muster only a pair of Boswell field goals.

As the game proceeded, it got more contentious, nearly out of control in the fourth quarter. And it cost the Bengals dearly.