It took nearly five years for James Cameron to bring “Avatar” to the big screen — but the Na’Vi have nothing on “Duke Nukem Forever.”

First announced in 1997, this videogame — featuring one of gaming’s best known characters — has been re-thought, re-booted and presumed dead multiple times. On Friday, Take-Two Interactive Software pulled off one of the gaming world’s biggest surprises, not only announcing a firm release date and expanded platform footprint — it will ship in 2011 for the PC, Xbox 360 and PlayStation 3 — but letting stunned gamers play it for the first time at last weekend’s Penny Arcade Expo, a fan-centric gaming event held in Seattle.

It’s something that was unthinkable just six months ago. 3D Realms, the creator and developer of the series, fired the entire development team in May 2009 when money ran out after 12 years of production. An ugly legal battle soon followed, with Take-Two suing 3D Realms, and 3D Realms countersuing.

But a few weeks later, Randy Pitchford, president of Gearbox Software and a poker buddy of the co-founder of 3D Realms, got involved.

Gearbox was riding high on the strength of its latest release — “Borderlands” — which had saved Take-Two’s recent fiscal quarter and was proving to have long legs at retail. Pitchford is a longtime developer, who had gotten his start at 3D Realms (and had even worked on “Duke Nukem Forever” when the game was first announced during the Clinton administration).

His suggestion: Have 3D Realms sell him the intellectual property they had held so dear for so long — and trust him and his studio, which had several other former 3D Realms coders, to honor the character of Duke Nukem and his legacy.

“We felt we were in a spot where we can fix this,” said Pitchford. “We’re local. Everyone trusts us. We can keep Duke alive.”

3D Realms co-owners George Broussard and Scott Miller agreed — and Take-Two agreed to drop the legal action. Just like that, Duke was alive once more.

Duke Nukem is a gaming icon. And while he might not be particularly well known among the general public, to gamers he is as familiar as Lara Croft, Mario and Sonic. With his flattop haircut, steroid-inflated physique and omnipresent one-liners, action gamers quickly rallied around him.

He’s an ass-kicker who likes his cigars and his women and has about as much use for political correctness as he does for the pig cops and alien shrink rays that pop up in his games. (Included among his famous over-the-top lines are “Your ass is grass and I’ve got the weed-whacker” and “Babes, bullets, bombs. Damn — I love this job!”)

The fourth installment of the franchise got caught up in a looping cycle — as developers strived for perfection, restarting the game several times but never getting it any closer to completion. That ultimately led to its demise.

It also led to the franchise becoming a running joke. It won Wired Magazine’s annual “Vaporware” award so many times that the publication gave it a lifetime achievement award so editors could focus on other products that failed to materialize.

Once Gearbox had acquired the IP and assessed the state of the game’s progress, a decision was made to keep the secret locked tight until the team was certain of the release date.

“We recognize that this is a brand you cannot make promises about,” said Pitchford. “There has been too much talk and not enough walk. … Let’s just show up at this show with the game and give people the opportunity to play it themselves.”

The game’s anything but a sure bet, given its perpetually-in-development history. But fans were raving after their taste of “Duke,” happy not only with the game itself, but that they’d finally gotten closure after all these years. (Not to mention that with the change in IP ownership, there’s bound to be even more Duke Nukem in the future.)

“When you think of this industry, there’s no other title that has had this much attention paid to it,” said Pitchford. “It’s almost sad to break the tension. We could always trust that story [of continual delays] was always going to be there for us. But all great stories have to have an end.”