Updated

NEW YORK — On the eve of his terrorism trial, an American student who studied in London admitted Tuesday that he helped a friend deliver some protective clothing to an Al Qaeda military commander fighting Americans in Afghanistan.

The plea by Pakistani-born Syed Hashmi to a single count of conspiracy to provide material support to Al Qaeda was entered in U.S. District Court in Manhattan, averting a trial that was supposed to begin Wednesday.

As part of a plea deal that will require prosecutors to drop three other terrorism charges at his June 7 sentencing, Hashmi agreed to serve 15 years in prison. He has already served four years, at least three of them in solitary confinement at a federal lockup next to the courthouse.

The 30-year-old Hashmi had faced up to 70 years in prison if convicted of four criminal counts.

"He'll be out of prison before he's 40 and have his whole life in front of him," defense attorney David Ruhnke said outside court.

Hashmi was arrested in 2006 in London and was brought to the United States a year later.

The bearded Hashmi, wearing a prison blue uniform and a white skull cap, smiled as he entered the courtroom and displayed his religious enthusiasm several times when he answered questions from Judge Loretta A. Preska.

"By the grace of Allah, yes," he said as he answered one question.

"All praise to Allah, no," he said in answer to another.

He answered a series of "yes" and "no" questions from Ruhnke to admit his crime. He admitted he knew that a friend who stayed with him in January 2004 for two weeks was storing some ponchos, waterproof socks and sleeping bags to be delivered to Al Qaeda.

Ruhnke asked if he knew Al Qaeda was designated a terrorist organization by the United States.

"Yes I did," he answered.

He also admitted providing $300 to his friend to obtain a plane ticket to fly to Pakistan and deliver the goods to the military commander who would relay them to fighters in Afghanistan.

"Did you understand Mr. Hashmi that those actions were unlawful?" the judge asked.

"Yes," Hashmi answered.

After the plea was accepted by the judge, Hashmi shook hands with his three defense lawyers before he was handcuffed and led out of the courtroom, which was ringed with court officers.

The defense lawyers then hugged each other.