By Bernard Vaughan NEW YORK, Sept 9 (Reuters) - Marvel Comics has agreed to settle a lawsuit by a comic book writer who sued the publisher over the copyright to the flaming-skulled character Ghost Rider. The agreement, disclosed in a letter filed Friday in U.S. District Court in Manhattan, if finalized would resolve five-years of litigation brought by former Marvel freelancer Gary Friedrich, who claimed he created the motorcycle-riding vigilante. Ghost Rider, who first appeared in comic books in 1972, has since gone on to be the central character of two films since 2007 starring Nicolas Cage. The settlement follows a decision by the 2nd U.S. Circuit Court of Appeals in New York to revive the lawsuit. A trial judge had previously dismissed the lawsuit, finding the rights to the character belonged to Marvel, owned by Walt Disney Co. In a letter to U.S. District Judge Katherine Forrest on Friday, Friedrich's lawyer, Charles Kramer, said that his client and Marvel "have amicably agreed to resolve all claims between, among, and against all parties." Forrest suspended deadlines in the case while the parties finalize the settlement. Trial was set to begin December 16. Friedrich began considering legal action against the comic book company in 2004 when he learned of an impending movie adaptation. He sued Marvel for copyright infringement, claiming that he owned the character and its use in films as well as toys, video games and other merchandise. Marvel argued that while Friedrich contributed ideas, the comic was created through a collaborative process. Kramer, Friedrich's lawyer, and a spokesman for Marvel did not immediately respond to requests for comment on Monday. The case is Gary Friedrich Enterprises, LLC et al v. Marvel Enterprises, Inc, et al, U.S. District Court, Southern District of New York, 08-cv-01533.