WELLINGTON, New Zealand — A high-ranking New Zealand military officer has been accused of hiding a camera in a bathroom at the nation's embassy in Washington in a case that has raised unusual jurisdictional questions.

Alfred Keating was a navy commodore and the embassy's senior defense attache at the time of the incident last July. He would have been eligible to claim diplomatic immunity from being prosecuted by U.S. authorities. But the case was handled by New Zealand police, who traveled to Washington to investigate.

A New Zealand judge on Friday dismissed an appeal by Keating to have his name and other personal details suppressed.

Keating, who has returned to New Zealand, has been charged with attempting to make an intimate visual recording. If convicted, he faces a maximum 18 months in prison.

Court documents say a camera was found in a unisex bathroom that was available for use by the 60 or so people who worked at the embassy.

"It had been purposely mounted inside a heating duct unit in the bathroom, at a height and direction that captured recordings from people who arrived and used the toilet," the documents say.

The camera was discovered after it fell on the floor. It had likely been in place for many months, according to the documents. It had been activated the morning it was found and had 19 images of people from that day, the documents say.

Prosecutors say they didn't find any indecent images when they searched Keating's computer but they did find that he had installed the driver software for the camera.

Bill Hodge, a teaching fellow at the University of Auckland's Law School, said the case had parallels with that of Julian Assange, the Wikileaks founder who has been cooped up in the Ecuadorian Embassy in London since 2012, where he remains beyond the reach of British authorities.

Hodge said that although Keating might be beyond the reach of American law, he could still be charged under New Zealand law. He said there were precedents, including cases for crimes at sea that took place outside New Zealand's territorial waters.

A pre-trial hearing has been scheduled for July.