A man jailed on terrorism charges two years ago was drawn into a plot to kill a federal judge in Ohio by another inmate attempting to reduce his own sentence, according to his attorney.

Pre-sentencing court documents filed this week by the defense said the other inmate pretended to show an interest in converting to Islam and then concocted the scheme against the judge.

Defendant Yahya Farooq Mohammad pleaded guilty this summer to supporting terrorism and trying to arrange the killing of a federal judge in Toledo overseeing his case.

Attorney Thomas Durkin said that even though the other inmate invented the plan against the judge, tape recordings of those discussions made a defense highly risky and improbable for Mohammad.

Federal prosecutors and the defense agreed to a plea deal that calls for Mohammad to spend 27 years in prison.

He decided to plead guilty instead of facing trial and a possible life sentence, Durkin said. Sentencing is set for next week.

Mohammad is one of four men with Ohio ties who were accused in 2015 of working to send money to Anwar al-Awlaki, an Al Qaida leader killed by a U.S. drone in 2011 and linked to the planning and execution of several attacks targeting American and Western interests.

The three others charged are awaiting trial, including Mohammad's brother who lived in Toledo after graduating from the University of Illinois. Mohammad studied at Ohio State University from 2002-04 and then moved to the United Arab Emirates.

Prosecutors said the money the men were gathering was intended to support efforts to carry out violence against U.S. soldiers in Iraq and Afghanistan.

They said in court filings this week that while in jail, Mohammad paid a hitman in an attempt to kill U.S. District Court Judge Jack Zouhary and talked about how he wanted the judge kidnapped to make sure his body wasn't found.

Prosecutors said the plot showed Mohammad "was truly committed to his cause."

Mohammad's attorney argued that prosecutors could not show that the money went toward any terrorist acts.

The defense also said that the unnamed inmate who orchestrated the assassination scheme won over Mohammad by wrongly telling him the judge had a role in the detention of Muslim men in Guantanamo Bay, Cuba.

The inmate, Durkin wrote, saw Mohammad as "his get out of jail free card from his 40-year state court sentence of imprisonment."

But the inmate later stopped working with prosecutors and contacted Mohammad's wife and his attorney once he realized his sentence and other pending charges weren't going away, Durkin said.