A US federal judge in Los Angeles has dismissed David Beckham's claim for libel and slander against a celebrity magazine that alleged he slept with a prostitute.

Beckham's lawyer, Richard Kendall, said the former England captain would appeal. Beckham, 35, who plays for Los Angeles Galaxy, began the legal action in September after In Touch magazine published a story that he had an affair with Irma Nici, 26, described as a former prostitute. Beckham has denied the allegation, and was seeking $25m (£15.5m) in damages.

Kendall said a basic investigation by the magazine would have shown Beckham was elsewhere at the time he was supposed to have been with Nici. In court papers, Beckham said he had been visiting his sick father in England at the time.

Kendall asked the judge to allow the case to proceed so that he could conduct depositions that would bolster Beckham's case, but the judge, Manuel Real, refused.

Beckham's lawyer told the Associated Press after the hearing: "We were left with two hands tied behind our back for the purposes of this motion."

The libel laws are more favourable to defendants in the US, especially with regard to public figures. Where a public figure attempts to bring a libel action in the US they must prove "actual malice": either knowledge that the information published was false, or a reckless disregard as to whether it was false.

Judge Real, in his ruling, said Beckham was a "public figure" and that his lawyers had failed to produce evidence to suggest In Touch had acted with malice. He also said any allegations of infidelity by Beckham would be of interest to the public.

Elizabeth McNamara, the lawyer for In Touch's owner, the Bauer publishing company, insisted the magazine did everything possible to corroborate details from Nici's interview. According to AP, McNamara told the court the woman's account was "entirely consistent with Mr Beckham's reputation as a serial philanderer".

After the hearing, McNamara said: "Obviously, we're pleased. We think the court followed the law and did the correct thing."

In his signed declaration, submitted to a court in Los Angeles, Beckham said the claims were "completely false" and had caused great distress to him and his family. He said: "I have never met Nici, let alone committed adultery with Nici or paid her for sex."

Bauer, however, argued that they did "nothing more than report what it believed was absolutely true".

Beckham's publicist Jeff Raymond said in a statement: "Bauer do not dispute for purposes of this motion that their story is false. They have not provided one shred of evidence to support the claim this story is true. David Beckham's clear evidence proved that this is without foundation.

"We have already won a court ruling in Germany and are awaiting damages. Unfortunately, the US legal system requires us to show that the magazine acted maliciously. Any knowledgeable person knows this story not to be true, and we will continue to fight this in court and the decision will be appealed."