SYDNEY (Reuters) - WikiLeaks founder Julian Assange on Wednesday reached the Northern Mariana Islands, where he is expected to plead guilty to violating U.S. espionage law that will set him free and allow him return home to Australia.

Assange, 52, has agreed to plead guilty to a single criminal count of conspiring to obtain and disclose classified U.S. national defence documents, according to filings in the U.S. District Court for the Northern Mariana Islands.

The U.S. territory in the western Pacific was chosen due to Assange's opposition to travelling to the mainland U.S. and for its proximity to Australia, prosecutors said.

"Julian Assange has arrived on U.S. territory at Saipan Island to formalise the plea deal that should never have had to happen," Wikileaks said on X.

Assange is due to be sentenced to 62 months of time already served at a hearing in Saipan in the Northern Mariana Islands, at 9 a.m. local time (2300 GMT Tuesday).

Australian-born Assange spent more than five years in a British high-security jail and seven holed up in the Ecuadorean embassy in London as he fought accusations of sex crimes in Sweden and battled extradition to the U.S., where he faced 18 criminal charges.

Assange's supporters view him as a victim because he exposed U.S. wrongdoing and potential crimes, including in conflicts in Afghanistan and Iraq. Washington has said the release of the secret documents put lives in danger.

Australian governments have been advocating for his release and has raised the issue with the United States several times.

"For any Australian to be in a position of being in protracted incarceration without legal resolution is a situation where the government should be advocating on their behalf and we have been doing that," Deputy Prime Minister Richard Marles told ABC television on Wednesday.

(Reporting by Renju Jose in Sydney; Editing by Stephen Coates)