Matthew Weiner now has an impressive paycheck to go along with all the kudos and acclaim he’s garnered for “Mad Men” during the past 18 months.

After one of the most protracted negotiations in memory, Weiner, creator and exec producer of the AMC period drama, sealed a two-year overall deal with Lionsgate TV on Friday that is said to be worth around $9 million. That’s big money for a showrunner by broadcast TV standards, let alone for basic cable. AMC is chipping in to help cover a portion of the deal.

Pact will keep Weiner at the helm of “Mad Men” for the next two seasons. It also covers TV development and includes a component for Weiner to develop a feature project for Lionsgate. There’s no specific idea on the table for the feature, but it won’t be “Mad Men” on the bigscreen, Weiner and Lionsgate execs said.

The deal was finalized Friday afternoon after months of negotiations and much speculation in the biz as to whether Lionsgate and Weiner’s reps at CAA and Industry Entertainment could come to terms. Last year, as the show’s second season generated a tsunami of pop culture buzz — and the Emmy win for best drama series — Weiner let be known that his contract was up and he was looking for a hefty raise to continue as showrunner.

Relations between Weiner and Lionsgate were strained for a period in the fall when Weiner made the rounds in prospective deal meetings with other networks and studios, while Lionsgate put out feelers to tenpercenteries inquiring about the availability of other showrunners.

But there was never any doubt that Weiner wanted to continue with the show he nurtured as a spec script for seven years before getting a greenlight from AMC. The instant critical acclaim for “Mad Men,” an ensembler set on Madison Avenue in the early 1960s, made AMC a player in the original series game overnight, and it gave a big boost to Lionsgate’s stature in the creative community.

In the end, AMC and Lionsgate had more to lose if they didn’t dig deep to keep the creative vision of “Mad Men” intact.

“I’m just very, very grateful,” Weiner told Daily Variety. “I feel rewarded and supported and now it is all about the future.” He emphasized that he respected Lionsgate and AMC for their willingness to take the risk on “Mad Men” in the first place.

Weiner’s sense of relief after inking the deal was shared by Lionsgate and AMC brass. AMC prexy Charlie Collier made a point of telling scribes at the Television Critics Assn. earlier this month that “Mad Men’s” third season would bow as skedded in the summer.

“It’s a happy day. We’re glad to have Matt back in the family,” said Lionsgate TV prexy Kevin Beggs.

Collier said the cabler was “thrilled to make an investment in Matt as we build our brand around having the best storytellers in TV.”

Now that his own future is settled, Weiner will spend the next few weeks ruminating on the overarching story for “Mad Men’s” third season. He expects his writing staff to be back at work by mid-February.