Jordan sentenced 10 militants to prison Tuesday for conspiring to attack U.S. forces in the country and in neighboring Iraq.

The men, sentenced to prison terms ranging from two to five years, yelled insults at the judges after the verdicts were read.

"God is our Lord and the tyrant is their master!" they shouted, accusing the United States of playing "master" to Jordan's judges and government, a moderate Arab regime with strong ties to the Washington and Israel.

The men planned to strike U.S. military personnel, who were in Jordan training Iraqi army and police recruits and Jordanian anti-terrorism officials, their indictment said.

It said the group surveyed its targets and sought to purchase weapons in Jordan and Saudi Arabia, with money raised by a man identified only as Abu Badr. It did not disclose his nationality.

The court acquitted seven other defendants for lack of evidence. Some kissed the ground upon hearing they would be freed. All 17 defendants had been in custody since their arrests in police sweeps across Jordan in July.

The defendants, ages 22 to 36, wore long beards and stood in the dock with their feet shackled during Tuesday's 15-minute hearing.

They were charged with an array of crimes, including conspiring to commit terrorism and attempting to harm Jordan's relations with a foreign country — a reference to Iraq, where the suspects allegedly planned suicide operations against U.S. forces.

The guilty verdicts can be appealed.

All 17 defendants pleaded not guilty at the start of their trial in September. Some told the court then that they believed jihad, or holy war, was not a crime.

One of those found guilty, a Jordanian of Palestinian origin identified as Loa'i Abu-Na'meh, had contacts with an unnamed Syria-based contact of Abu-Musab al-Zarqawi, the Jordanian-born leader of Al Qaeda in Iraq, according to the indictment. Abu-Na'meh was sentenced to four years in prison.

Al-Zarqawi is responsible for deadly suicide bombings, beheadings and kidnappings in Iraq, as well as triple hotel blasts that killed 60 people in Jordan in November.

The indictment said none of the other defendants is believed to have a direct link to al-Zarqawi's group or other known terrorist organizations.

The indictment said the terror plot was hatched in Jordan in 2005 by ringleader Mu'tasem Suleiman, a Jordanian of Palestinian origin, who was sentenced to five years in jail.