A Pakistani court on Wednesday formally opened the trial of five Americans charged with terrorism and plotting attacks, which could see them jailed for life, lawyers said.

The five men aged 19 to 25 have denied the charges. The prosecution brought witnesses to the anti-terrorism court convened under tight security at a jail in the eastern city of Sargodha, where they were arrested in December.

"The formal trial has begun," defense lawyer Hassan Katchela said.

The five were indicted on March 17 on charges of funneling money to outlaws and plotting a terror attack "within Pakistan or an allied country.”

Although those countries have not been named, Pakistani officials say the men planned to travel to neighboring Afghanistan and join up with Taliban-led militants who have been fighting U.S. and NATO troops for more than eight years.

The suspects say they wanted to travel to Afghanistan only for charity work.

The five have been named as Umar Farooq, Waqar Hussain, Rami Zamzam, Ahmad Abdullah Mini and Amman Hassan Yammer.

Reporters were barred from the closed-court session.

Katchela said the prosecution produced five witnesses on Wednesday, out of a total of 23, including four staff from hotels in the cities of Lahore, Karachi and Hyderabad, where the men had stayed, and a police officer.

The hotel staff were cross-examined and the defense found several "contradictions and discrepancies," Katchela said.

"The statement of district police officer was recorded and he will be cross-examined during next hearing, which will be held on April 17," he said.

Afterwards, Katchela said he held a "very fruitful" discussion with his clients.

Fellow defense lawyer Tariq Asad said the suspects hoped to be freed.

"Their spirit is still high. They seem satisfied and hopeful of being acquitted," Asad told reporters.

Khalid Farooq, the Pakistani father of one of the U.S.-born suspects, said, "They are innocent, and I do not think that the court and judges will think otherwise. This is a clear-cut case, and I'm confident they will be acquitted."

"They were planning to go to Afghanistan to help Muslims there. It is not unusual for Muslims in the United States, as they always stand ready to help Muslims wherever they are in trouble," Farooq said.

"But they did not adopt proper channel. They should have talked to me, and we would have done all these things through proper channel."

Investigators say the men planned to travel from Sargodha to South Waziristan, a training ground for Islamist networks in Pakistan's lawless tribal belt that was subject to a major military operation last year.

Although the Pakistani government is a close U.S. ally in the war on Al Qaeda and the Taliban in Afghanistan, the country is gripped by widespread anti-Americanism, and many Pakistanis blame deteriorating security on the alliance.

Washington has put the government and military under major pressure to do more to eliminate Islamist networks that have carved out havens in the country's northwest and infiltrate Afghanistan to attack Western troops.