Independent presidential candidate Robert F Kennedy Jr does not meet the legal requirement of a New York resident and therefore cannot be on the state’s election ballot, a judge has ruled.

Kennedy’s claim of a New York address as his “place of residence” on nominating petitions was a “false statement”, said Judge Christina Ryba.

As a result, the petitions were considered invalid. Mr Kennedy has rejected the judge’s ruling and vows to appeal.

If the ruling is upheld, it would not only bar Mr Kennedy from the New York ballot but could also lead to challenges in other states where he uses that address.

Mr Kennedy dismissed the ruling as a partisan attack and noted the judge as a Democrat.

“They aren’t confident they can win at the ballot box, so they are trying to stop voters from having a choice,” he said in a statement.

“We will appeal and we will win.”

Mr Kennedy, 70, had argued in court that he considered New York his home since childhood and intended to return.

He currently lives in California which he moved to in 2014 to be with his wife, Curb Your Enthusiasm actress Cheryl Hines.

In court, Mr Kennedy sought to make the case that he has been renting a bedroom from a friend in Katonah, roughly 40 miles (65 km) north of Manhattan.

The friend, Barbara Moss, testified in court that she charges Mr Kennedy $500 (£301) a month. She also said there was no written lease.

Mr Kennedy also offered evidence of his residency by showing that he pays New York state taxes and has a law practice in the state.

However, in her 34-page ruling, Judge Ryba said “the overwhelming credible evidence introduced at trial” suggested that Mr Kennedy only held a New York address for “political standing”.

“Given the size and appearance of the spare bedroom as shown in the photographs admitted into evidence, the Court finds Kennedy’s testimony that he may return to that bedroom to reside with his wife, family members, multiple pets, and all of his personal belongings to be highly improbable, if not preposterous,” the judge wrote.

Mr Kennedy is the most well-known independent candidate but his popularity appears to have plummeted since Democratic Vice-President Kamala Harris entered the race.