FOXBOROUGH, Mass. -- The New England Patriots have locked up both their young tight ends to long-term extensions after reaching agreement with Aaron Hernandez on a deal through 2018, sources told ESPN.com on Monday.

A league source said the extension is for five years and includes a $12.5 million signing bonus, $16 million in guaranteed money, and a maximum value of $40 million in additional money.

The source said the contract would start after his rookie deal ends in two years.

Hernandez, appearing at the Patriots' annual Charitable Foundation Kickoff Gala in the Putnam Club at Gillette Stadium on Monday night, was clearly thrilled and emotional about the contract extension.

"I knew it was coming, just cause, when Gronk (Rob Gronkowski) got it, I knew there was a good chance I was next in line," he said. "Now that it happened, it's definitely a blessing, and take it in, I'm excited to go on with my life.

"As soon as we started talking about contracts, I was emotional from that day on," he continued. "Honestly, it's hard for me here (at the gala) to stay, keeping my mind off it, and it's just, like I said, it's surreal. Probably when I'm done with this conversation I'll get some tears in my eyes. But it's real, and it's an honor."

Upon agreeing to the extension, Hernandez made a charitable gesture that Patriots owner Robert Kraft appreciated.

"One of the touching moments since I've known the team -- knowing that this is our charitable gala tonight -- Aaron came into my office, a little teary-eyed and presented me with a check for $50,000 to go to Myra Kraft Giving Back Fund," Kraft said. "I said 'Aaron, you don't have to do this, you've already got your contract.' And he said 'No, it makes me feel good and I want to do it.' "

To Kraft, Hernandez's donation reflected the organization's desire to have players give back after receiving financial security by playing in the NFL.

"That made me feel good because part of the thing that we learned early on is that we have a lot of young men who come into this business, and they come from humble financial homes, and part of what we try to do is make them understand is that there is a psychic income involved in giving back both your time and your financial resources, if you can do that," he said.

"And I sensed that he was touched in doing that. We didn't request it, it's something that he decided. And to flip the switch from living modesty to all of the sudden having a lot of income, I think we have to work real hard to help our young men adjust to that."

Coach Bill Belichick seemed pleased with the developments as well.

"Any contract that we agree to is one that we're in support of," he said Monday when asked about the contract. "If we agree to a contract on a player, then we're in support of that player, the length of the contract, the amount that we're paying him, and all the other things that go with the contract. We wouldn't do it if we weren't in support of it, as an organization, me personally, all of the above. Again, we wouldn't have done it if we weren't happy with it. Glad it worked out."

Belichick also lauded Hernandez's improvement and versatility.

"Aaron has improved a lot," Belichick said. "He's worked hard, he's improved a lot in all phases of the game: passing game, running game, protection and his overall versatility. He's done a good job for us."

All-Pro Rob Gronkowski agreed in June to a six-year, $53 million extension, the richest contract for a tight end in NFL history. Gronkowski's contract includes a $10 million option -- if exercised by the Patriots in 2015 -- that would extend it through 2019.

The 22-year-old Hernandez, who like Gronkowski is entering his third NFL season, caught 79 passes for 910 yards last season, third on the team behind Gronkowski's 1,327 and Wes Welker's 1,569.

Hernandez averaged 11.5 yards per reception with seven touchdowns in 2011.

At the end of the 2011 season, Hernandez's offensive role expanded to include aligning as a running back. He finished with eight carries for 70 yards during the Patriots' playoff run to Super Bowl XLVI.

This preseason, Hernandez has even fielded punts for the team, returning one punt for five yards in the team's recent 30-28 loss to the Buccaneers.

With Hernandez signed through 2018, the Patriots now have eight core offensive players under contract through at least the 2014 season.

Hernandez's deal, however, casts further doubt on the long-term status of Welker.

The receiver signed a $9.5 million franchise tender in May. Last month, he arrived at training camp saying it was great to be back and that he was not disappointed at not locking up a long-term deal.

"It's good for him. I'm definitely happy for him," Welker said of Hernandez's deal. "He's a great player and done a lot of great things for us. Good to have him here."

When asked what the Hernandez extension means as it relates to his own prospects for receiving a long-term deal this offseason, Welker deferred comment.

"I think you have to ask Coach Belichick that," he said. "I'm just going out here and doing my job to the best of my ability, and let everything else take care of itself."

Should the Patriots choose to franchise Welker again this offseason, his salary would increase to $11.4 million for the 2013 season.

Field Yates is a frequent contributor to ESPNBoston.com's Patriots coverage. Information from ESPN NFL Insider Adam Schefter and ESPNBoston.com's Mike Reiss was used in this report.