Julian Assange, the founder of WikiLeaks, received a hero’s welcome even before he arrived back in his home country of Australia on Wednesday after pleading guilty to a felony charge of violating the U.S. Espionage Act.

Australian politicians sprinted to publish statements supporting a plea deal that gained him his freedom. Kevin Rudd, the former prime minister who is now Australia’s ambassador to the United States, even joined him in the U.S. courtroom on the Pacific island of Saipan.

That Mr. Assange’s case concluded in a distant outpost — the capital of the Northern Mariana Islands, a commonwealth tied to America through post-World War II imperialism — seemed fitting.

He ended his standoff with the American government far from Washington, 14 years after he published classified military and diplomatic documents, revealing secret details about U.S. spycraft and the killing of civilians during the wars in Iraq and Afghanistan.

He was a divisive figure then — a brave journalist to some, a reckless anarchist who endangered Americans to others. He became even more polarizing during the 2016 presidential election, when WikiLeaks published thousands of emails from Hillary Clinton’s campaign and from the Democratic National Committee that had been stolen by Russian hackers.

But after five years in a British prison, and marriage and fatherhood, Mr. Assange had turned into a figure more appealing for Australians. Somewhere along the way, he became the underdog forced to endure superpower pique, and in a land settled by convicts, a rebellious bloke who had done his time and deserved to return home.