GUANTANAMO BAY NAVAL BASE, Cuba - An Australian detainee held for five years at Guantanamo Bay was found guilty Friday of supporting terrorism, marking the first conviction at a U.S. war-crimes trial since the Second World War.

David Hicks, a 31-year-old Muslim convert, faces a prison sentence of up to seven years under a plea agreement revealed Friday that also requires him to drop any claims of mistreatment by the U.S. government since he was captured in Afghanistan and taken to Guantanamo Bay, said the judge, marine corps Col. Ralph Kohlmann.

If sentenced to seven years, the plea agreement calls for an unknown portion of that to be suspended.

Hicks had pleaded guilty to the charge Monday night but was not actually convicted until Kohlmann accepted his plea during Friday's session.

The agreement calls for Hicks to be returned to Australia within 60 days of his sentencing, which is expected within days. The U.S. government had previously agreed to let him serve any sentence in Australia.

Intense lobbying by Australia, including by Prime Minister John Howard, appears to have been a key factor in the U.S. decision to make Hicks the first detainee to go before war-crimes trials authorized in October by U.S. President George W. Bush, and the agreement to return Hicks to Australia.

Omar Khadr, a Canadian citizen accused of killing a U.S. medic in Afghanistan in 2002 when he was 15, is expected to be the second or third detainee to go on trial at the U.S. military base in southeast Cuba. But there has been no public lobbying for Khadr to serve any sentence in Canada.

A spokesman for Foreign Affairs in Ottawa declined Thursday to discuss whether the government would push for a deal like the one received by Hicks.

"The government of Canada sought and received assurances that Mr. Khadr is being treated humanely,'' said Alain Cacchione. "He faces very serious charges, but as far as serving his sentence in Canada, it is premature and speculative at this point.''

For his appearance Friday, Hicks, 31, was dressed in a grey suit, dark tie and with his hair newly cut short. The former outback cowboy and kangaroo skinner who aided al Qaeda during the U.S.-led invasion of Afghanistan showed little emotion as he confirmed to the judge that he conducted surveillance on the former American Embassy in Kabul.

Hicks could have been sentenced to life in prison. He had been also charged with supporting terrorist acts, but that count was dismissed as part of the agreement.

Hicks, who had complained of abuse in U.S. custody in Afghanistan and at Guantanamo, agreed as part of the deal that he had "never been illegally treated by a person or persons while in the custody of the U.S. government,'' Kohlmann said.

He will also be required to co-operate with U.S. and Australian authorities to share his knowledge of al Qaeda and a militant Pakistani group, Lashkar-e-Tayyaba, which helped him travel to Afghanistan to attend terrorist training camps.

"Any failure to cooperate with U.S. or Australian law enforcement may delay your release from confinement,'' Kohlmann said.

In the days before his arraignment Monday, Hicks' lawyers said their client was severely depressed and anxious to find a way to leave Guantanamo, where he lives by himself in a small maximum-security cell. Observers including Hicks' father, Terry Hicks, have suggested he pleaded guilty only to escape the isolated military prison.

After taking an oath to tell the truth, Hicks told the judge that he pleaded guilty because he believed the government had enough evidence to convict him at trial.

Speaking in a deep voice, he said he reached that conclusion after seeing "notes by interrogators taken from me.''

Hicks is the only detainee charged so far under a new military tribunal system. Prosecutors say they plan to charge as many as 80 of 385 men who have been held for years in the Guantanamo U.S. military compound without trial on suspicion of links to al Qaeda or the Taliban.

The Pentagon established the tribunals to try foreigners deemed "enemy combatants,'' claiming the authority to hold them indefinitely and try them outside of U.S. civilian courts or courts-martial because they represent a terror threat to the United States.

The Supreme Court, which struck down a previous tribunal system at Guantanamo as unconstitutional, is considering a challenge of the law passed last year to establish the revised tribunals. Some members of Congress have also vowed to repeal the law that eliminates detainees' access to U.S. courts.