NORFOLK, Va. — A Virginia man who authorities say wanted to carry out a terrorist attack and tried to fund Islamic State group terrorists has been sentenced to 20 years in prison.

Prosecutors say 27-year-old Lionel Williams was sentenced Wednesday in federal court in Norfolk. He had pleaded guilty in August to terrorism charges.

The case against Williams began after authorities say he pledged allegiance to terrorists on Facebook. Federal agents soon learned the Suffolk man owned an assault rifle.

Authorities say Williams told undercover FBI agents that he wanted to attack “hard targets” such as police officers. Court documents said he also gave informants $250, which he believed was going to fund the Islamic State in Iraq.