A former transit-agency police officer has been sentenced to 15 years in prison after being convicted in a sting operation of attempting to help the Islamic State group.

Nicholas Young was a patrol officer in the D.C. region's Metrorail system. He was known as "Officer Friendly" at the Takoma Park station where he was assigned.

RELATED: Former DC police officer convicted of trying to aid Islamic State

A federal jury convicted the 38-year-old Young in December on multiple counts, including attempted material support of a terrorist group.

Young purchased more than $200 in gift cards he believed would be used to purchase mobile-phone apps that the Islamic State could use to communicate securely. In reality, though, Young's Islamic State connection was an FBI informant.

RELATED: Former DC Metro cop charged with trying to support ISIS

At Friday's sentencing hearing, Young said he was prosecuted only after he refused an FBI offer to be an informant.