It took two years, a few missed workouts, a franchise tag and what must have been dozens upon dozens of conversations, but Muhammad Wilkerson finally got the long-term deal he was looking for, and the Jets now have their Pro Bowl defensive lineman locked up for five more years.

Even if they waited until the last possible moment to do it.

Shortly after Friday’s 4 p.m. deadline for teams to sign franchise-tag players, the Jets announced on their website that they had locked up Wilkerson, who played last season on the fifth-year option of his rookie contract and has spent the last two seasons lobbying for job security, even skipping a few voluntary workouts in 2015. The five-year deal is worth $85 million and will pay Wilkerson $37 million in the first two years and $54 million in the first three, according to a source. His first three years are guaranteed.

Wilkerson and his agent had been seeking a deal close to the one signed by Texans defensive end J.J. Watt, who is making $100 million over six years in a contract signed in 2014. Wilkerson’s guaranteed money exceeds Watt’s $51.9 million.

“I’m excited to be back with a great organization for another five years,” Wilkerson said in a video tweeted out by the Jets’ official account. “Looking forward to great things. Go Jets.”

Wilkerson added on his own Twitter account: “I give my all every Sunday on the field and play with so much love and passion for the game. I’m thankful for everything that comes my way and proud to say I’m back on the green and white for a few more years #96#MKG #jetlife”

advertisement | advertise on newsday

Wilkerson led the Jets with 12 sacks last year and spearheaded a defense that routinely stifled the run, holding opponents to 83.4 rushing yards per game. He’s amassed 301 combined tackles and 36 1⁄2 sacks in his five-year career. And though Wilkerson broke his right leg against the Bills on Jan. 3 in the last game of the 2015 season, he would have been one of the elite free-agent defensive options had the Jets not ponied up the cash.

The premium on high-caliber defensive players is high, and that became obvious even before Wilkerson signed his contract. Earlier Friday, the Broncos wrapped up Super Bowl MVP Von Miller for what NFL Media reported as an unprecedented six-year, $114.5-million deal. It is the biggest contract ever given to a defensive player, and $70 million of that is guaranteed.

In a team statement, Miller said he was “super-happy and excited to be back with my teammates for the next six years . . . I am so appreciative and grateful for this opportunity. I am excited for the future and ready to get back to work.”

One of the top edge rushers in football, the linebacker had 35 combined tackles, 11 sacks and four forced fumbles in the regular season last year. In the playoffs, he added 13 combined tackles, five sacks and two forced fumbles in Denver’s run to a Super Bowl victory.

Kirk Cousins, Alshon Jeffery, Eric Berry and Trumaine Johnson, however, will play this season under the value of their tags after they and their teams failed to agree on long-term contracts by Friday’s deadline.

With Bob Glauber

and Kimberley A. Martin