Two and a half years after they entered the negotiating room, “Family Guy” creator Seth MacFarlane has sealed an overall deal with 20th Century Fox TV, keeping him in business with the studio through 2012.

Terms of the deal were not disclosed, but should MacFarlane’s properties, which also include “American Dad” and upcoming “Family Guy” spinoff “The Cleveland Show,” hit all their financial goals, the value of the pact could ultimately enter the nine-figure range.

Deal not only keeps MacFarlane in place as exec producer of “Family Guy,” “American Dad” and now “The Cleveland Show,” but it also keeps him in place as the key vocal talent on both “Family” and “Dad.” MacFarlane is also set to lend his voice to a neighbor character on “Cleveland.”

As for the recent suit MacFalane and 15 other “Family Guy” scribes filed against 20th Century Fox TV, that had no relation to the contract negotiation. That complaint, filed April 10 in Santa Monica, relates to the 2005 DVD “Family Guy Presents Stewie Griffin: The Untold Story.”

“It effectively locks me into 20th,” MacFarlane said. “They have found ways to allow us to do what we need to do to make the show what it is. It’s great to be in a permanent, stable relationship … because I like to think that I have a number of other shows in me.”

That includes “Cleveland,” as well as a live-action multicamera laffer he’s developing with “Family Guy” consulting producer Gary Janetti. (MacFarlane and Janetti, who recently sealed his own deal with 20th, are still kicking around ideas.) “The task at the moment, now that this is done, is to figure out ways to expand while keeping ‘Family Guy’ as high quality as we hope it has been,” MacFarlane said.

Deal was a long time coming for MacFarlane and 20th Century Fox TV — and both sides expressed relief at finalizing it. Studio was set to announce the pact several times in recent weeks, only to hold off at the last minute as final points were still hammered out.

“In a way, it does feel like one of the last big monster deals,” said 20th Century Fox TV chairman Gary Newman. “Deals like this are driven by the value of a piece of business that has already been created. It’s so difficult to create shows like ‘Family Guy’ and turn them into such enormous financial assets.”

At the center of the deal, noted 20th Century Fox TV chairman Dana Walden, was the fact that “Family Guy” remains a cultural phenomenon — and one that has survived two cancellations by Fox.

“It’s one of those few series an exec gets to work on in their career that rises to a level where it’s not just a TV show anymore,” she said. “The audience for this show is so dedicated that it becomes a prime brand for a company like ours.”

The negotiations took several twists and turns through the years.

“I think everyone feels that it took a lot longer than we’d have liked it to.” MacFarlane said. “There was a point where I thought, ‘This might not happen.’ ”

Talks came to a stalemate by fall 2006, with 20th delaying the start of production on “Family Guy’s” sixth season in an attempt to push along negotiations. (The studio didn’t want to start production only to stop later if a deal wasn’t reached.) Production finally got on track, and scribes reported back to work, 2½ months later in January 2007 after negotiations progressed to a point where a deal appeared imminent.

Meanwhile, MacFarlane sealed a deal with indie shingle Media Rights Capital to create Web shorts — including 50 segs for Google. (Under terms of his new studio deal, MRC is in second position to 20th, and anything that resembles a TV project immediately goes to the studio.)

Then came the writers strike. MacFarlane went public with his irritation at 20th after the studio opted to complete “Family Guy” episodes without his involvement. (MacFarlane said those episodes have now been recut, under his supervision.) “I think tempers became a little more heated during the strike,” he said. “I don’t know that I ever thought of going as far as not reupping with them, but at the time it was very tense.”

Walden agreed that things got hairy as negotiations dragged on.

“It would not be honest to suggest there weren’t days filled with mild anxiety that we would never come to a mutual understanding,” Walden said. I don’t think either party was inclined to look very seriously at the option of moving on.”

As for the deal itself, that hefty nine-figure number is contingent on a number of factors all winding up in MacFarlane’s favor. Those factors include, among others: “Family Guy” remaining on air through the course of the deal; a big syndication deal for the more recent shows; continued strong DVD sales; and a rich second cycle off-net syndication pact for “Family Guy.”

“People are thrilled, there’s no lingering resentment or feeling that we were taken advantage of, and certainly Seth has to be feeling pretty great about his financial future as well as his professional future,” Walden said. “Today is a new day, we’re moving on.”

“The Cleveland Show” came about after Mike Henry (who voices Cleveland on “Family Guy”) and “American Dad’s” Rich Appel approached MacFarlane about the idea of a spinoff.

“There was to me no other sensible option than to say yes,” MacFarlane said. “There were some conversations about what this means for ‘Family Guy,’ but I think that the upside potentially outweigh the downside.”

Beyond that, MacFarlane said he’d like to continue expanding his Fuzzy Door shingle to include multiple skeins and feature projects. And that includes a long-rumored “Family Guy” movie, which MacFarlane would like to produce in the next few years. There’s no firm plan yet, although any feature will likely center on homicidal toddler Stewie, he said.