The Patriots escaped with a hard-fought 23-21 win over the Bills Sunday despite a less-than-stellar performance from the offense and a few miscommunications on defense. But they also had a surprising number of solid performances on both sides of the football that should make Patriots fans a bit more optimistic for the rest of the season.

A breakdown of all three phases of the game after reviewing the TV tape and the coaches’ film:

■ Tom Brady needed 52 passes to get his 288 passing yards, but he was masterful when he had to be, particularly in the fourth quarter when he connected with Danny Amendola five times for 49 yards. His 9-yard touchdown pass to Julian Edelman in the first quarter had eyes, somehow squeezing right past Jim Leonhard and Kiko Alonso into the tightest of windows.

And the play of the game was Brady’s 10-yard pass to Amendola in blanket-tight coverage on third and 8 with 1:20 left in the fourth quarter. If Brady doesn’t thread that pass, and Amendola doesn’t make an incredibly tough catch in traffic, the comeback might not happen.

Get Sports Headlines in your inbox:

The Globe's most recent sports headlines delivered to your inbox every morning.

■ The Bills disguised their pressure really well with their zone blitzes, often showing big blitz but then rushing only four or five defenders. Defensive tackle Marcell Dareus, listed at 331 pounds, was surprisingly nimble when dropping into coverage, and played the role of QB spy on a half-dozen snaps. They also showed a “sugar” rush on a handful of snaps, in which each player in the front seven began the play in a two-point stance, making it tough to determine who was rushing the quarterback.

The offensive line’s performance looked much better on the film than it felt at the game. The line opened several big holes for Stevan Ridley and Shane Vereen up the left middle behind Logan Mankins, Ryan Wendell, and Nate Solder. Vereen had runs of 19, 20, and 21 yards, and Ridley had a 20-yarder, all to the left-middle.

■ Not to get too down on a rookie playing in his first game, but receiver Kenbrell Thompkins was pretty awful in several areas, showing very little awareness. In addition to catching only 4 of 14 passes thrown his way, double-clutching his catches, and slipping and falling on multiple occasions, he twice wasn’t able to tap his foot down for a catch — once along the sideline, once in the back of the end zone.

Thompkins made a sliding catch on a slant pass down at the 2-yard line, but he would have had a touchdown if he had just stayed on his feet. And he ran the wrong route on the goal line in the fourth quarter, running right into Edelman and forcing Brady to take a sack on third down.

■ Center Ryan Wendell seemed to be tipping the snap with his head movement. He would look down and then up right before the snap, and the Bills jumped it several times. Jerry Hughes jumped offsides a couple of times after mistiming the head snap.

■ Vereen’s performance is even more impressive given what we now know, that he fractured a bone on his left wrist early in the game and still finished with 101 rushing yards, plus seven catches for 58 yards. He clearly avoided using his left hand throughout the game, yet he still had better ball protection than Ridley, who was benched after fumbling.

When the Bills had the ball . . .

■ The Bills’ game plan with rookie quarterback E.J. Manuel was obvious: Keep it simple. Of his 27 passes, we counted 20 that traveled fewer than 10 yards in the air. He aired it out just four times, and coincidentally, two went for touchdowns: 18-yarders to Robert Woods and Stevie Johnson. Nine of Manuel’s 18 completions were check-downs to Fred Jackson (four catches, 41 yards) and C.J. Spiller (five catches, 14 yards).

The Patriots’ plan to stop Manuel was obvious, as well: Keep him in the pocket and make him beat them with big throws. He dropped back to pass 30 times, and we counted just six blitzes. The Patriots didn’t sack Manuel and hit him only three times, but he threw for just 150 yards, scrambled for only 23, and his longest pass was 19 yards.

■ The Patriots did a nice job of containing Spiller (2.4-yard average on 17 carries) but Jackson is still a beast at 32 years old. He averaged 5.2 yards on 13 carries and finished the game with 108 of the Bills’ 286 total yards.

■ On Johnson’s 18-yard TD in the third quarter, safety Devin McCourty took one brief step in, as if he were anticipating a slant pass over the middle. But Johnson ran a deep corner route, burned past McCourty and Kyle Arrington, and caught an absolutely perfect pass from Manuel for the score.

■ CBS commentator Dan Dierdorf was highly critical of the decision by coach Doug Marrone to stick with the up-tempo, no-huddle offense while nursing 4- and 1-point leads in the fourth quarter. The Bills barely took any time off the clock with drives of 1:11, 2:07, and 1:20, and snapped the ball with 20-25 seconds left on the play clock on most plays.

Special teams . . .

■ An up-and-down day for new punter Ryan Allen. He did an excellent job corralling a bad snap on the Patriots’ 48-yard field goal in the first quarter, and three of his six punts were downed inside the 20.

But his net average of 36.0 isn’t very impressive, he had a bad 19-yard punt into the wind in the second quarter, and he didn’t show very good touch on a 65-yard punt that resulted in an unnecessary touchback.

■ Matthew Slater proved why he is one of the best special teams gunners in the game, making an impressive sliding play to deflect one of Allen’s punts on the short hop and prevent it from reaching the end zone. Stephen Gostkowski had five touchbacks in six kickoffs and went 3 for 3 on field goals, and linebacker Jamie Collins came THIS close to blocking a punt.

BILL WIPPERT/ASSOCIATED PRESS

Danny Amendola’s performance on a balky groin (10 catches, 104 yards) was as gutsy as it gets.

Game balls:

■ Amendola: His performance on a balky groin (10 catches, 104 yards) was as gutsy as it gets.

■ Vereen: We take it back; gaining 159 total yards with a fractured wrist is equally gutsy.

■ TE Michael Hoomanawanui: Had a workmanlike effort as the only healthy tight end, playing 78 snaps (averaged 23 per game last year) and providing solid blocking in the run and pass games.

■ DE Rob Ninkovich: Was excellent in containing the edge in run coverage, finishing with eight total tackles and a fumble recovery.

■ Arrington: Had a knack for making big plays, finishing with four tackles, two forced fumbles, and a pass break-up.

BostonGlobe.com complimentary digital access has been provided to you, without a subscription, for free starting today and ending in 14 days. After the free trial period, your free BostonGlobe.com digital access will stop immediately unless you sign up for BostonGlobe.com digital subscription. Current print and digital subscribers are not eligible for the free trial.

Thanks & Welcome to Globe.com

You now have unlimited access for the next two weeks.

BostonGlobe.com complimentary digital access has been provided to you, without a subscription, for free starting today and ending in 14 days. After the free trial period, your free BostonGlobe.com digital access will stop immediately unless you sign up for BostonGlobe.com digital subscription. Current print and digital subscribers are not eligible for the free trial.