FOXBOROUGH, Mass. (AP) Tom Brady appeared for his postgame media session with an ice pack on his right elbow. Bill Belichick was sporting a brand new AFC East championship hat.

The New England Patriots had things a little tougher this year, but they came out on top yet again.

Brady passed for 271 yards and a touchdown, sneaked for a third-down conversion to set up another score and threw a downfield block on another scoring drive to help the defending Super Bowl champions beat Buffalo 24-17 on Saturday and clinch their 11th straight AFC East title.

''I'm pretty poor at just about everything other than throwing the ball,'' said Brady, who is 42 and nursing a right elbow injury but still absorbed a crunching tackle after a 3-yard scramble that was followed one play later by Rex Burkhead's go-ahead touchdown.

''He's the heartbeat of this football team,'' special teams captain Matthew Slater said. ''We've been one of the most fortunate organizations the last 20 years to have that guy at the helm. He proved it again tonight.''

With Bills visiting for a rare late-season matchup while the division was still at stake, Burkhead rebounded from an opening-drive fumble to catch four passes for 77 yards and run for 20 more, including a 1-yard touchdown with 5:11 left to give New England the lead. Brady found Julian Edelman, who was in the concussion protocol earlier in the second half, on the 2-point conversion to make it 24-17.

Both teams had already clinched playoff berths; the Patriots (12-3) remain in contention for a first-round bye or even the No. 1 seed in the AFC.

''You couldn't ask for a better situation, playing for an AFC division title in December with two games left to give yourself a chance,'' said Bills quarterback Josh Allen, who drove Buffalo to the New England 8 in the final minutes but couldn't deliver a touchdown. ''I'm super thankful for this experience and what we were able to do here. At the same time, we came here to win a football game, and we didn't get that done.''

Allen completed 13 of 26 passes for 208 yards and ran for 43, including a first down on fourth-and-1 from the Patriots 30 with about three minutes left. With a first-and-goal from the 8, he was stopped on a run, overthrew Dawson Knox in the end zone and then was sacked by Adam Butler.

Facing fourth-and-goal from the 15 with just over one minute left, he was forced out of the pocket and had to throw the ball up for grabs in the end zone, where it was knocked down by J.C. Jackson.

''It was a playoff-type game,'' Bills running back Frank Gore said. ''We played against a good team and it came down to us on the 10-yard line.''

Sony Michel ran for 96 yards for the Patriots, who would earn a first-round bye if Kansas City loses or ties one of its remaining two games.

Cole Beasley caught seven passes for 108 yards, and John Brown had a 53-yard touchdown reception for the Bills (10-5), who have qualified for the postseason for the second time since 1999. They have not won a playoff game since 1995, following their last division title, when Marv Levy's team beat Don Shula's Miami Dolphins in the wild-card round.

Brady improved to 32-3 against the Bills, who haven't beaten the Patriots in six games under coach Sean McDermott.

''Obviously they're AFC East division rivals and that's their consecutive whatever-it-is year winning the division,'' said Allen, who thew for a touchdown in his 21st straight game, breaking Doug Flutie's franchise record from 1998-99. ''We've got to find a way to get over that hump.''

The Bills made only one big play in the first 29 minutes, when safety Jordan Poyer punched the ball out of Burkhead's hands, and Micah Hyde returned it 31 yards to the New England 31. That led to a field goal and a 3-0 lead.

Brady responded with a 75-yard drive, going 5-for-5 and hitting Matt LaCosse for an 8-yard score that made it 7-3. It was the three-time NFL MVP's 539th TD pass, tying Peyton Manning for second behind Drew Brees, to Brady's 76th different receiver, extending what was already a record.

New England led 10-3 before a failed attempt on fourth-and-inches with 36 seconds left in the half gave the Bills one more chance before the break.

Allen connected on two passes before dropping one in on Dawson Knox for 33 yards; although it was originally ruled a touchdown, replays showed he was brought down at the 1. Two plays later, 320-pound tackle Dion Dawkins was wide open for the touchdown that sent it into the half tied 10-10.

After the Patriots opened the second half with Folk's 51-yard field goal - the team's first attempt from more than 50 yards all season - Allen connected with Brown from 53 yards to make it 17-13. It was Allen's longest pass of the season.

''We knew we had to finish the game,'' Poyer said. ''That's the greatest quarterback to ever play the game, and we knew they were gonna come back and try to strike.''

INJURIES

Bills: C Mitch Morse had his lower right leg being worked on late in the game.

Patriots: DB Jason McCourty, who missed last week's game, left the game after aggravating a groin injury. OL Marcus Cannon left with an ankle injury and did not return. WR Edelman appeared to enter the concussion protocol after a collision that led to an offensive pass interference penalty against him. He went to the blue tent and then the locker room but returned to the game.

UP NEXT

Bills: Host the New York Jets on Sunday.

Patriots: Host Miami on Sunday.

---

More AP NFL: https://apnews.com/NFL and https://twitter.com/AP-NFL

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.