A German-Syrian man admitted Thursday to belonging to a terrorist group and training in an al-Qaida paramilitary camp in Pakistan, and now faces up to five years in prison under a plea deal, German officials said.

Frankfurt state court judge Thomas Sagebiel said Rami Makanesi's full cooperation with investigators made the plea deal possible as his trial began.

Makanesi told judges he fully admits to the charges, though no plea was entered according to the German system.

"He wants to take the responsibility for his deeds," defense attorney Michael Koch said.

The 25-year-old told the court that he did not have a particularly religious upbringing in the Frankfurt suburb where he grew up, but in 2007 met radical Muslims in local mosques and became more interested in radical Islam online.

"I looked at internet propaganda," he told the court. "I listened to the speeches of Osama bin Laden and Ayman al-Zawahiri."

According to German officials, after Makanesi was further radicalized he moved to Hamburg and became one of about a dozen radical Muslims who left the northern German port city in March 2009 to pursue terrorist training in Pakistan.

As Makanesi recounted his approximately 13 months in Pakistan to the court, he looked relaxed sitting on the defendant's bench, wearing a black T-shirt and Reebok track pants, while occasionally waving to his mother, brothers and cousins in the room.

While in the Pakistan-Afghanistan border region, Makanesi said he struggled to endure physical hardships as he trained in the use of handguns, assault rifles, mortars and other weapons to use in al-Qaida's fight.

"I'm a city person. I didn't know life in the mountains at all," he said.

Makanesi said he then sought a way of going home to Germany to continue supporting al-Qaida from there. He told his commander "that I'm not capable for the armed struggle, but that I could raise funds."

But he was arrested in June by Pakistani security forces on his way to Germany's embassy in Islamabad where he had hoped to receive valid travel documents to return home — where he had left his wife and their daughter behind.

He was later extradited to Germany.

Another member of the group from Hamburg, Ahmed Siddiqui, was arrested last year in Afghanistan and provided interrogators details of an early-stage terrorist plot in Europe, which led the U.S. and others last year to issue a travel alert for Europe. Some details revealed by Makanesi confirmed information provided by Siddiqui.

A verdict and sentence is expected on Monday.