By Esme Murphy

MINNEAPOLIS (WCCO) — A man who threatened to kill FBI agents and a federal judge was free Tuesday evening after pleading guilty to a misdemeanor in federal court.

Khaalid Abdulkadir, a 19-year-old who has ties to a group of young Minnesota terror suspects, had faced a felony charge that could have landed him 25 years in prison if convicted.

But in a deal with prosecutors, Abdulkadir pleaded to a misdemeanor and was sentenced to three years of probation.

Abdulkadir’sdefense attorney says the plea deal came about because of an 11th hour disclosure by the prosecution, suggesting agents weren’t that worried about the Twitter threats.

After spending three months in jail, Abdulkhadir walked out of the Minneapolis federal building on Tuesday with family and friends.

“I am happy to be free at last,” he said. “I am going to stay far away from trouble and any law enforcements and I am just going to be a good person.”

Abdulkhadir posted the two threatening tweets after his friend, Abdirizak Warsame, was arrested in December on charges of trying to join ISIS.

One of the tweets read “kill them FBI and [expletive] as judge.”

In court documents, prosecutors also had argued that Abdulkadir had exchanged 30 direct messages in January of 2015 with the notorious fugitive and Minnesota native known as Mujahid MIski.

In those messages, Abdulkadir expressed a desire to join Miski, who at the time was recruiting for Al-Shabaab in Somalia.

But the defense had argued that Abdulkadir never intended to carry out the threats and deleted them 20 minutes after he posted them.

“My client is 19 years old, and that is going to be a factor in anything,” defense attorney Chris Madel said. “Nineteen-year-olds do dumb things.”

Abdulkadir himself said that when he posted the tweets he never considered the possible consequences.

“I had no meaning behind it,” he said. “It just happened.”

U.S. Attorney Andy Luger released a statement saying that Abdulkadir’s three years of probation is evidence his office will forcefully prosecute anyone who threatens to kill federal officials.

Abdulkadir will be on electronic home monitoring and his computer use will be restricted.

Esme Murphy