WASHINGTON (Reuters) - Free speech organizations welcomed Monday's news of Wikileaks founder Julian Assange's release from jail in Britain but said the U.S. case had still set a bad precedent by punishing him for this long.

Assange is due to plead guilty on Wednesday to one charge of violating U.S. espionage law, in a deal that will allow him to return home to Australia, ending a 14-year legal odyssey that could have landed him in jail for many decades.

U.S. authorities in 2019 charged Assange on 18 criminal counts of conspiring with former U.S. Army intelligence analyst Chelsea Manning to obtain classified information and unlawfully publishing the names of classified sources.

Several rights groups, leading media organizations and the leaders of countries like Mexico, Brazil and Australia had urged that the charges against Assange be dropped.

Among those who welcomed his release were the advocacy group Committee to Protect Journalists and free speech organization Knight First Amendment Institute at Columbia University.

"Julian Assange faced a prosecution that had grave implications for journalists and press freedom worldwide," CPJ CEO Jodie Ginsberg said in a statement.

Assange's supporters say he is a hero who was victimized because he exposed U.S. wrongdoing and alleged war crimes, including in conflicts in Afghanistan and Iraq. Washington says the release of documents he helped publish put lives in danger.

"While we welcome the end of his detention, the U.S.'s pursuit of Assange has set a harmful legal precedent by opening the way for journalists to be tried under the Espionage Act if they receive classified material from whistleblowers. This should never have been the case," Ginsberg said.

Similar sentiments were echoed by Jameel Jaffer, executive director of the Knight First Amendment Institute.

"A plea deal would avert the worst-case scenario for press freedom, but this deal contemplates that Assange will have served five years in prison for activities that journalists engage in every day," Jaffer said in an emailed statement.

"It will cast a long shadow over the most important kinds of journalism, not just in this country (U.S.) but around the world," Jaffer said.

(Reporting by Kanishka Singh; Editing by Sonali Paul)

By Kanishka Singh