New England’s offensive line was a work in progress that wasn’t showing much progress.

The player the Patriots could least afford to lose was under pressure in the very first game behind a rebuilt line that had just lost its toughest blocker.

Four sacks of Tom Brady in that 33-20 loss to the Miami Dolphins 12 days after six-time Pro Bowl left guard Logan Mankins was traded to Tampa Bay didn’t bode well.

But the linemen stayed confident as they grew accustomed to their first-year assistant coach Dave DeGuglielmo and are ready for Saturday’s divisional playoff game against the Baltimore Ravens.

“It’s just a matter of going through a lot of things together and gaining that familiarity,” left tackle Nate Solder said after that game. “I think it will all work together as long as we continue to do the things that we’re coached to do.”

The cohesion and communication improved as the season went on.

The Patriots (12-4) allowed 10 sacks in the first four games, going 2-2. They finally settled on a starting line in the fifth game and allowed just 16 sacks in the final 12 games with a 10-2 record.

That’s 26 total sacks, 14 fewer than the Patriots allowed last season.

“The big thing is communication and working together,” said Dan Connolly, the team’s most veteran lineman who started the first three games at center before settling in at Mankins’ position. “We’re kind of the team within the team. The five of us have got to work together in our blocking combinations.”

That togetherness will be tested Saturday against one of the NFL’s most aggressive pass rushing teams.

The Ravens (11-6) were tied for second with 49 sacks. A bunch of those came with just three or four pass rushers.

“We’re blessed with a number of guys that can really rush the passer,” Ravens coach John Harbaugh said. “It gives you one extra guy in coverage. So the fewer guys you can send to get pressure on the quarterback, the better off you’re going to be.”

At least admitted plodder Brady has shown a greater tendency to scramble this season.

He had his longest run since 2007 in the 14th game, a 41-13 victory over Miami.

Brady ran 17 yards for a first down before taking a hard hit that knocked him out of bounds at the Dolphins 3-yard line. On the next play, the Patriots scored on LeGarrette Blount’s 3-yard run for a 21-13 lead on the first possession of the third quarter.

Against the Ravens, Brady will try to avoid Elvis Dumervil, who had 17 sacks, Terrell Suggs, who had 12, and the rest of their pass rushers.

“They do a great job getting after the quarterback,” Brady said. “They blitz a decent amount of times, so we’re going to need to be able to move around in the pocket and try to buy ourselves a little more time. All of these guys can still run me down. It doesn’t matter. I’m still slower than all of those guys.”

The emergence of rookie center Bryan Stork was critical to the line’s improvement. He’s been helped by having former centers Connolly and Ryan Wendell on either side of him.

Connolly said Stork is growing up and becoming a good professional.

“We’ve got to let him just run the show. He’s the center. He’s got to do those sorts of things,” Connolly said. “But it always helps to have guys next to you that know what’s going on.”

When Connolly missed a Jets game with a knee injury, Brady was sacked four times. Connolly and right tackle Sebastian Vollmer (back injury) missed the last game and the Patriots allowed four sacks, three against backup Jimmy Garoppolo.

Both linemen might have played in the finale had the Patriots not clinched the AFC’s top seed before that 17-9 loss to Buffalo.

Brady will need all five regulars against the Ravens.

“All of those guys are tied together. That job is tough to do,” Brady said. “They’ve got the best athletes, maybe in the world, sitting on the other side trying to go kill the quarterback and they’ve got to do everything they can to defend and not hold.”

And keep Brady safe.

“It’s a lot of pressure on us,” Connolly said. “It’s our job to make sure Tom stays upright, so that’s what we’re going to try to do this week.”

Join our Newsletter for the latest news right to your inbox