A legal dispute over the hit action franchise -- in which Stallone has been taking punches from writers who claim their work was stolen -- exposes the whole messy system of who gets credit for what.

This story first appeared in the Feb. 7 issue of The Hollywood Reporter magazine.

Sylvester Stallone experienced a Rocky Balboa-style comeback with The Expendables, his 2010 film about a team of mercenaries hired to eliminate a Latin American dictator. But even as the film grossed $274.5 million worldwide and spawned a sequel (with another on the way this summer), Stallone has been taking punches from writers who claim their work was stolen.

PHOTOS: Sylvester Stallone's On-Screen Arsenal of Guns Through the Years

In an unusually contentious example of how murky authorship can be in Hollywood, Stallone, who is credited as the co-writer of Expendables, has gone to battle against one writer in arbitration and another in federal court. He's been flagged by a judge for making two conflicting arguments. And lately, the situation has become so heated that an appeals court intervened and a new lawsuit was filed that threatens to undercut the traditional screenwriter credit process.

The story dates back to 2002, when writer David Callaham signed a two-picture agreement with Warner Bros. The first script was for a movie based on the video game Doom, which Universal ended up releasing in 2005. The second was Barrow, which Callaham wrote after reading about the U.S. government's hiring of Blackwater military contractors in Iraq. That script went unproduced until 2008, when Stallone -- who had become interested in exploring the "mercenary theme," according to court documents -- was sent Barrow by his William Morris agent.

Soon after, Stallone got to work on Expendables, which triggered a claim by Callaham that Barrow was being used without permission. A WGA arbitration commenced, and in 2009, Callaham prevailed and was given "co-writer" and "story by" credits and $102,250 in bonus payments.

PHOTOS: Oscar Nominees

Expendables then became a huge hit, prompting Stallone and producers, including Nu Image, Millennium Films and Alta Vista Productions, to begin work on a sequel. But because Callaham was credited on the first film, he owns what's called "separated rights," requiring producers to pay him on all sequels. Nu Image's Avi Lerner, one of Hollywood's most notoriously litigious executives, wasn't happy about this situation, so on Dec. 23, the producers sued Callaham and the WGA for fraud. They allege Callaham committed "subterfuge" during the arbitration process and fraudulently gained the "co-writer" and sole "story by" credits. They also claimed they have uncovered old emails from Callaham where he says the Expendables script is "nothing like" what he originally wrote. The producers are demanding Callaham return money and are asking a judge to declare that Stallone be given sole screenplay credit (and sole rights to the franchise). They also ran to court to stop a new WGA arbitration scheduled for Jan. 31 over $175,000 in bonus money (plus interest) that Callaham is owed for Expendables 2, which grossed $305.4 million worldwide in 2012. A judge refused to stop it, and the lawsuit proceeds.

STORY: Studios Back WGA Payment Initiative

If Callaham loses, it could throw into question the validity of the WGA arbitration process, exposing writers to claims of fraud if their personal feelings about the evolution of their scripts later are used against them. "The WGA credit process is one of the least understood and most important," says litigator Joe Taylor at Liner Llp., who often represents talent in credit disputes. "If you get credit, you get hooked into royalties forever."

But the Expendables fight doesn't end there. In October 2011, writer Marcus Webb sued Nu Image, Stallone, Callaham and others, claiming that Expendables wasn't based on Barrow but rather on Webb's own mercenaries script titled The Cordoba Caper. In response, Stallone's lawyers -- in an apparent contradict­ion of the producers' argument in the Callaham case -- pointed out that Callaham's script predated Webb's and thus, Expendables was independently created. Stallone offered a sworn declaration that described how he liked Barrow and maintained its structure while writing a new version. "In those rewrites, I kept Callaham's story about a group of highly trained mercenaries overthrowing the dictator of a Latin America island," Stallone said.

The problem, of course, was that Nu Image already had tried to minimize Callaham's contributions. U.S. District Judge Jed Rakoff noticed the inconsistency, and in a December 2012 ruling, he slammed Stallone. "Indeed, the admission smacks more than a little of hypocrisy," the judge wrote. "Stallone previously asserted in a signed letter submitted in his [WGA arbitration] that although he read Barrow, he 'set it aside' and that Expendables was 'an original … and doesn't use one word, one comma, one iota from [Barrow].' " Nonetheless, even after expressing reservations about Stallone's credibility, the judge found that Webb had failed to show that his work was "so strikingly similar" to Expendables "as to permit a reasonable juror to infer access."

STORY: WGA Contract Talks With Studios to Begin Feb. 3

But that's not the end to this mercenary tale. Webb appealed, and on Jan. 15 -- only weeks after Nu Image sued Callaham and the WGA for fraud -- the 2nd Circuit Court of Appeals held oral arguments. Webb's attorneys made sure the judges were aware that producers simultaneously held up proof that Expendables was and wasn't based on Callaham's script.

The producers now say the arguments aren't inconsistent, legally speaking. But what the dispute means for writers like Callaham -- and for the future of what could soon be a billion-dollar franchise -- isn't settled.

Email: Eriq.Gardner@THR.com

Twitter: @eriqgardner