BIRMINGHAM, Ala. — An Alabama man pleaded guilty to terrorism charges Thursday, admitting that be bought bomb-making materials and had hoped to conduct attacks at a military installation or police stations.

In federal court in Birmingham, Aziz Sayyed, 23, of Huntsville, entered the plea to charges that he sought to aid a foreign terrorist organization.

Federal prosecutors said that, after watching videos from the Islamic State terrorist group earlier this year, Sayyed purchased ingredients to make an explosive and told others about his hope to use it in a car bomb or explosive belt. Sayyed also shared the videos and expressed his support for the terrorism organization and terrorist attacks.

According to the plea agreement, Sayyed told people he wanted to attack police stations or the Redstone Arsenal military installation in Huntsville. He was arrested after discussing his plans with an undercover FBI agent in June.

Sayyed’s plea agreement stipulates a 15-year prison sentence. He is scheduled to be sentenced in June.

A lawyer representing Sayyed could not immediately be reached for comment.

US Attorney Jay E. Town of Alabama said a tip led to the investigation and arrest.

“Sayyed was brought to our attention because citizens saw something, so they said something. If we are to keep our cities safe, no matter the type of suspicious activity, our community must play an active role,” Town said in a statement.