A federal US judge dismissed Wednesday a child sex assault lawsuit brought against Bryan Singer, the director of the blockbuster "X-Men" films.

Aspiring actor Michael Egan III had claimed that Singer forced him to have sex at parties in California and Hawaii in the late 1990s, when Egan was 17 years old.

Egan filed a lawsuit in April in Hawaii, weeks before the release of the latest "X-Men" film, "X-Men: Days of Future Past."

He had denied that the timing was aimed at maximizing the pressure on Singer, saying it was instead due to a legal "window" in Hawaii that meant he had to file then or drop the case.

But on Wednesday a judge in Hawaii granted an order for voluntary dismissal, according to court documents.

Judge Susan Oki Mollway denied Singer's request for his attorney's fees and costs to be paid.

A representative for the director, 48, did not immediately respond to a request for comment.

At the time the director's lawyer Marty Singer -- no relation -- called the claims defamatory and absurd.

"It is obvious that this case was filed in an attempt to get publicity at the time when Bryan's new movie is about to open," he said at the time.

Following the lawsuit the director decided not to participate in promotional events for the latest "X-Men" movie, which opened in May.