A man who allowed a friend turned government cooperator to store camping equipment in his London apartment and then loaned him $300 to take it to an al-Qaida commander in Pakistan pleaded guilty late Tuesday on the eve of trial.

Syed Hashmi, 30, a Pakistani-born naturalized U.S. citizen, spared himself a possible life sentence by admitting to one count of conspiracy to provide material support or resources to the terrorist group. Lawyers for Hashmi and prosecutors reached a plea deal Tuesday, with the government agreeing to drop substantive material support and other charges and Hashmi accepting a likely sentence of 15 years in prison, which would have him free by the time he turns 40.