A man will stand trial in London next year accused of illegally entering Windsor Castle armed with a loaded crossbow with intent to harm Queen Elizabeth II, a judge said on Wednesday.

Jaswant Singh Chail, 20, was detained in the grounds of the royal residence west of London on Christmas Day last year when the queen was there.

He was arrested and charged with three offences, including one under the 180-year-old Treason Act of "intent... to injure the person of Her Majesty Queen Elizabeth II, or to alarm Her Majesty".

He allegedly told a protection officer when he was apprehended: "I am here to kill the queen."

In the last such case, Briton Marcus Sarjeant was jailed for five years in 1981 after pleading guilty to firing blank shots at the monarch when she was on parade.

Chail, who appeared at the Central Criminal Court, or the Old Bailey, via video-link, is also charged with making a threat to kill and possession of an offensive weapon.

The unemployed former supermarket worker spoke only to confirm his name and date of birth. A plea hearing will be held in December.

Judge Nigel Sweeney set a provisional trial date for March 20, 2023 and remanded Chail, from Southampton, southern England, in custody.

Queen Elizabeth II died on September 8 aged 96 after a year of failing health.