PITTSBURGH (AP) The Buffalo Bills didn’t have many playoff experiences during a recent two-decade stretch.

Bills coach Sean McDermott and his quarterback Josh Allen are helping to change the culture in Buffalo.

Allen threw a 14-yard touchdown pass to Tyler Kroft with 7:55 to play and the Bills clinched a playoff spot, beating the Pittsburgh Steelers 17-10 on Sunday night.

“(McDermott) preaches playoff caliber and that’s the standard we hold ourselves to,” Allen said. “The goal is to get yourself into the playoffs to have a shot at the Super Bowl.”

The Bills (10-4) have done that.

They secured their second playoff berth in three seasons under McDermott. Buffalo trailed 10-7, but scored on two possessions in the fourth quarter, as Allen rallied the Bills for a comeback win for the fifth time this season. Consecutive interceptions by Jordan Poyer and Levi Wallace on Pittsburgh’s last two possessions sealed the victory.

The surging Steelers (8-6) had an opportunity to leapfrog the Bills for the top AFC wildcard spot, but Buffalo snapped Pittsburgh’s three-game win streak. The Steelers remain the No. 6 seed in the AFC, but they have no room for error.

“We will learn from this and move forward to our next opportunity,” said Steelers coach Mike Tomlin, a college teammate with McDermott at William & Mary. “There is scarcity in this business. You only get so many opportunities to state a case for yourself.”

Buffalo won for the fourth time in five games and recorded its first 10-win season since 1999. The Bills also beat the Steelers for the second time ever in Pittsburgh, first since a 21-point win in the 1993 AFC Divisional playoff round.

The Bills, who improved to 6-1 on the road, made their first Sunday night appearance in 12 years when they were dismantled by the Patriots in a 46-point loss.

Not this group, led by a No. 3-ranked defense and an opportunistic offense.

The Bills no longer resemble the inept franchise with a revolving door of coaches, general managers and quarterbacks that struggled through a 17-year playoff drought before McDermott and general manager Brandon Beane arrived.

Allen completed 13 of 25 passes for 139 yards with a touchdown and an interception. Allen, who also rushed for a score, has only lost consecutive games once in his career. Kroft scored his first touchdown since 2017 when he played for Cincinnati. Devin Singletary rushed for 87 yards and John Brown caught seven passes for 99 yards. He became Buffalo’s first 1,000-yard receiver since 2015.

The Steelers entered with wins in seven of their last eight games since a 1-4 start.

Devlin Hodges completed 23 of 38 passes for 202 yards with one touchdown and four interceptions. Hodges had a chance to become the first undrafted rookie in the Super Bowl era to win his first four starts.

James Conner played for the first time since missing five of the last six games with a shoulder injury. He finished with 42 yards rushing and caught a touchdown pass.

“After a loss like that, it’s kind of quiet,” Hodges said. “Everyone knows what’s on everyone’s mind. Not a whole lot of talking needs to be done.”

Pittsburgh scored on the first drive of the second half to take a 10-7 lead.

Hodges opened the series with a 31-yard pass to Diontae Johnson and Conner broke off a 17-yard run, setting up his 11-yard touchdown reception two plays later. The 69-yard touchdown drive came after Pittsburgh totaled 64 yards in the first half.

Tre’Davious White returned his second interception of the game 49 yards to the Pittsburgh 18 late in the third quarter. The Bills couldn’t capitalize with a touchdown and instead settled for a 36-yard field goal by Stephen Hauschka to tie it.

The Bills took the lead for good on their next possession.

Allen connected with Brown for a 40-yard gain one play after a Pittsburgh punt. Five plays later, Allen found Kroft at the front pylon for a 14-yard touchdown pass.

“We were on the same page,” Kroft said. “I saw the coverage and I knew I had to get my head around fast. He threw a perfect strike and it made my job easy.”

Allen’s 1-yard touchdown run on the second play of the second quarter opened the scoring.

Allen’s ninth score also established a new single-season franchise record for touchdowns rushing by a quarterback. Buffalo took advantage of a short field following a 22-yard punt and converted a fourth down during the 40-yard series.

Pittsburgh trailed 7-3 when Steven Nelson picked off Allen late in the second quarter. A facemask set Pittsburgh up with first-and-goal from the 10, but Johnson fumbled and the Bills recovered to preserve a four-point halftime lead.

The defense also helped lead the Bills back to the playoffs again.

“Before we got here, it was a 17-year drought,” said White, the Bills’ first round pick in 2017. “Since we’ve been here, we’ve been to the playoffs two out of the last three years. It’s pretty special because these things don’t come around often.”

NOTES: Allen tied Doug Flutie for the most consecutive games accounting for a touchdown by a Bills quarterback with 20. ... T.J. Watt is the first player in Steelers history with multiple 13-sack seasons. ... Pittsburgh registered at least one sack in 55 straight games, the longest in regular-season franchise history. ... Chris Boswell kicked his 125th career field goal, fourth-most in Steelers history. ... The matchup featured the first trio of brothers – Pittsburgh’s Trey and Terrell Edmunds and Buffalo’s Tremaine Edmunds – to appear in the same game since 1927.

UP NEXT

Bills: Travel to New England on Saturday.

Steelers: Visit the New York Jets on Sunday.

Copyright 2019 by STATS LLC and Associated Press. Any commercial use or distribution without the express written consent of STATS LLC and Associated Press is strictly prohibited.