A 23-year-old Glencoe man who threatened to blow up a metro Walgreens in March has pleaded guilty to lying to FBI agents about his contact with the terrorist organization known as ISIL a year ago.

Abdul Raheem Habil Ali-Skelton entered the plea Wednesday in federal court in St. Paul.

Ali-Skelton came to the attention of federal agents investigating Minnesotans with links to international terrorist groups, and told them in July 2015 that he was last in touch with Syrian members of the Islamic State of Iraq and the Levant (ISIL) in late May or early June of that year. In fact, prosecutors said, he had exchanged more than 75 messages with them between June 27 and July 4 using a social media account he tried to conceal from the FBI.

Five days after Ali-Skelton came under federal charges last month, he was arrested at a Brooklyn Park Walgreens after he threatened to blow up the store and said he was "part of a terrorist organization," according to court documents filed in Hennepin County.

The early morning incident on March 27 was sparked by Ali-Skelton accusing another customer of having relations with his girlfriend and threatening the man with a bottle. When a store manager intervened, Ali-Skelton said he had a gun and would shoot up the store. He later admitted to officers that he made the threats to shoot up the store but did not remember referring to a terror organization or saying he would blow up the Walgreens.

A source familiar with the case said it is unrelated to the ongoing investigation of a group of Somali-American men in the Twin Cities suspected of plotting to travel to Syria and fight with ISIL. Three of 10 men charged in that case are scheduled to stand trial in Minneapolis on May 9.

On Monday, Ali-Skelton pleaded guilty in Hennepin County to making terroristic threats and was released from custody pending a June 30 sentencing.

After his guilty plea in federal court on Wednesday, U.S. District Judge Donovan Frank ordered Ali-Skelton into federal custody, saying nothing else could ensure the safety of the community.

Stephen Montemayor • 612-673-1755

Twitter: @smontemayor