(973espn.com) - The odds didn't necessarily look great with free agency approaching but the Philadelphia Eagles were able to agree to terms on a three-year extension with defensive lineman Brandon Graham on Friday.

The veteran, originally a first-round pick in 2010, is now under contract through the 2021 season. The deal is worth $40 million, including a guarantee of $27M and an average annual value of over $13M per season.

The architect of perhaps the most important play in franchise history despite battling through ankle and hamstring issues -- the Super Bowl LII strip sack of Tom Brady which essentially clinched the first Eagles world championship since 1960 -- Graham is coming off another season in which he produced pressure at an elite level -- a career-high 40 quarterback pressures and hits.

The sacks that result in big salary-cap numbers didn't follow, however, complicating negotiations.

Graham, though, indicated his desire at staying in Philadelphia and at least hinted at a potential hometown discount after the 2018-19 season ended with the divisional-round loss in New Orleans.

“I felt good leaving the room,” Graham said on a Friday conference call. “I really still didn’t know how this thing would go, but I knew how fast everything would start to hit me when free agency started, but I knew I always wanted to check what Philly had to offer first before anything.”

Graham, who will turn 31 in April, was scheduled to be a free agent on March 13 at a position which costs a premium in the NFL and that  inability to finish [he's never had double-digit sacks in his career] versus his dominance as a two-way player made things difficult for Roseman, who has been mulling an extension with Graham dating back to 2017.

The edge market in free agency appears to be a deep one but that will likely change by March 5, where players like DeMarcus Lawrence, Jadeveon Clowney, Dee Ford, and Frank Clark could get the franchise tag if their teams can't work out long-term deals with them. That would have left Graham and perhaps New England's Trey Flowers as the jewels of the market at a position that generates the most money after quarterback.

Spotrac.com had estimated Graham's potential market value at over $15 million per season.

“Honestly me and my family love our situation here in Philly,” said Graham. “I’ve done well with what I’ve been given already and saving my money. I wasn’t that far off from where I wanted to be with the Eagles. We ended up making it work. I feel like we built something here and I want to finish it out if it made sense and it ended up making sense."

The consistency of Graham's pressure since he turned the corner in Philadelphia is up with the NFL's best edge players, something when coupled with his ability to defend the run and the versatility to also play at a high level on the interior, have made Graham a unique and not so easily-replaced player. He is No. 7 in Eagles' history with 42 1/2 sacks and leads the team with 61 tackles for loss and 12 forced fumbles since 2014.

Graham and All-Pro tackle Fletcher Cox spearhead an Eagles defensive line that ranked first in the NFL in sacks, QB hits and total pressures in 2018.

Philadelphia is now presumably set at DE with Graham, Michael Bennett, Derek Barnett and Chris Long under contract, although Long could still opt for retirement and Bennett could be in line for a restructure.

“I just want to thank Howie and coach (Doug Pederson) and (owner) Mr. (Jeffrey) Lurie for believing in me one more time. I think for me it was a no brainer,” Graham said.

-John McMullen covers the Eagles and the NFL for 973espn.com. You can reach him at jmcmullen44@gmail.com or on Twitter @JFMcMullen

More From 920 ESPN New Jersey