By David Ingram

(Reuters) - A woman who said in court papers she was forced as an underage girl to have sex with Britain's Prince Andrew, prominent U.S. lawyer Alan Dershowitz and other men cannot join an ongoing lawsuit in Florida, a federal judge ruled on Tuesday.

The lawsuit, filed in 2008, seeks to undo a non-prosecution agreement between federal prosecutors and convicted sex offender Jeffrey Epstein, who the woman said arranged the sex with Prince Andrew and Dershowitz.

U.S. District Judge Kenneth Marra in West Palm Beach, Florida, ruled that it was unnecessary for the woman, known in court papers as Jane Doe No. 3, and another known as Jane Doe No. 4 to join the lawsuit.

Prince Andrew and Dershowitz have denied the allegations, which for three months have been a tabloid sensation in the United States and the United Kingdom. A lawyer for Epstein has called the allegations old and discredited.

Epstein, a financier from New York, pleaded guilty in a Florida state court in 2008 to procuring an underage girl for prostitution. He served a year in jail, and the U.S. Justice Department agreed not to bring federal charges.

Marra wrote that he would decide later on the merits of the case, in which two other women, known as Jane Doe Nos. 1 and 2, say federal prosecutors violated their rights as crime victims when signing the deal with Epstein.

The judge said he could still consider relevant evidence from Jane Doe Nos. 3 and 4, but that their participation in the case "as listed parties is not necessary in that regard."

Jane Doe No. 3 said in a statement released by her lawyers: "I'm happy to get to participate in this important case."

A Buckingham Palace official said Prince Andrew has been informed of the latest developments in Florida. He is spending this week privately, before resuming his schedule of public engagements next week.

Dershowitz, a Harvard Law School professor emeritus, said Marra's ruling was a complete vindication of his position. A lawyer for the women's legal team said it was not.

Marra ordered struck from the record, for now, what he called the "lurid" accusations against Prince Andrew and Dershowitz. He declined a request from Dershowitz to go further, writing that striking the details "is sanction enough" for the women's lawyers, Paul Cassell and Brad Edwards.

Cassell and Edwards have sued Dershowitz for defamation. Dershowitz has counter-sued them for defamation.

A lawyer for Epstein did not immediately respond to requests for comment.

Federal prosecutors, who had opposed the request by Jane Doe Nos. 3 and 4 to join the lawsuit, had no comment, a spokeswoman for the U.S. Attorney's Office in south Florida said.

The case is Jane Doe v. United States, U.S. District Court for the Southern District of Florida, No. 9:08-cv-80736.

(Reporting by David Ingram in New York; Additional reporting by Guy Faulconbridge in London; Editing by Ted Botha)