The New England Patriots took a strong step toward locking down the future of their offense by signing Aaron Hernandez to a contract extension Monday.

Just months after signing Rob Gronkowski to a six-year extension, New England gave its other tight end a five-year extension that ensures the duo will continue to create matchup nightmares for defenses through the 2018 season.

Hernandez’s deal carries a maximum value of $40 million and comes with a $12.5 million signing bonus and $16.4 million guaranteed. Hernandez also has $1.115 million remaining on his rookie deal, which was set to expire following the 2013 season.

“It’s good for him,” said wide receiver Wes Welker, who failed in his attempt to secure a long-term deal this winter. “I’m happy for him.”

A hybrid player, Hernandez, 22, caught 79 passes for 910 yards and seven touchdowns last season over 14 games. He also ran the ball five times for 45 yards.

“Aaron’s worked hard and improved a lot in all phases of the game,” coach Bill Belichick said. “Passing game, running game, protection, his overall versatility -- he’s done a good job for us. He’s a hard guy to cover.”

New England was previously reluctant to negotiate new deals with players still on their rookie contracts, but it showed a shift in philosophy by negotiating a six-year, $54 million extension with Gronkowski in June. By taking a similar course of action with Hernandez, the team avoids entering a round of potentially complicated negotiations.

If New England had allowed Hernandez to enter free agency and then failed to reach an agreement with him, signing him under the franchise tender likely would have been a complicated task.

Packers tight end Jermichael Finley recently attempted to argue that he should be considered a wide receiver since he splits out on the majority of his snaps. Green Bay buckled and gave him a two-year, $15 million deal, and Hernandez would have likely tried a similar approach. If Hernandez won that argument, the Patriots would have had to shell out more money to keep him in the fold.

The agreement is good for both sides. Hernandez, a former fourth-round pick out of Florida, gets rewarded for outperforming his deal and New England now has Gronkowski, Hernandez, QB Tom Brady, WR Brandon Lloyd, G Logan Mankins, T Nate Solder, OL Dan Connolly, RB Stevan Ridley and RB Shane Vereen all locked up through at least the 2014 season.

The biggest winners, though, may be the other young players in the locker room that now know they will be taken care of if they exceed expectations early in their deals.

Nick Underhill covers the Patriots for MassLive.com. Follow him on Twitter @CBSSportsNFLNE or @nick_underhill