Alexander Ciccolo participates in a peace walk through Brighton, Ontario in July 2012. The FBI says Ciccolo was preparing to launch a terrorist attack this month. (Dave Fraser/Northumberland News via AP)

A 23-year-old son of a Boston Police Department captain has been charged with illegal possession of firearms, and the FBI thinks he was making preparations to launch a terrorist attack targeting a college cafeteria, according to court documents.

Alexander Ciccolo, 23, was arrested July 4 on the way to his house in Adams, Mass., after meeting with an FBI confidential informant who provided him with two handguns and two semiautomatic rifles.

Ciccolo’s arrest was made public Monday, and he is being held pending a detention hearing Tuesday.

Authorities said Ciccolo, who admitted his support for the Islamic State, had hoped to carry out the attack this month.

FBI Director James B. Comey told reporters last week that the bureau had arrested nearly a dozen people in recent weeks, some of whom may have been plotting attacks timed around the July 4 holiday.

The U.S. Attorney's office released a photo showing two Glock pistols and two assault rifles allegedly purchased by Alexander Ciccolo. (U.S. Attorney's Office / Handout/EPA)

Last month, members of the Joint Terrorism Task Force in Boston shot and killed a terrorism suspect who was armed with a knife. The FBI said the man had talked about killing a police officer. Two of his associates were charged with providing material support to the Islamic State.

The FBI learned about Ciccolo, a convicted felon, in September after a close acquaintance said he had expressed a desire to travel overseas and fight for the Islamic State, according to court papers. The unnamed acquaintance also said that Ciccolo had a long history of mental illness.

A U.S. law enforcement official said Ciccolo’s father first notified authorities about his son’s plans.

In a statement, the Ciccolo family said: “While we were saddened and disappointed to learn of our son’s intentions, we are grateful that authorities were able to prevent any loss of life or harm to others.”

Drawing inspiration from the Boston Marathon bombing, Ciccolo said he wanted to use pressure cookers packed with shrapnel to attack a university in the Northeast and described its cafeteria as “very sinful and has a crowd,” according to the court documents.

Authorities did not name the university.

On July 3, FBI agents watched as Ciccolo bought a pressure cooker at a Wal-Mart in North Adams, Mass.

Investigators also seized several partially constructed Molotov cocktails during a search of Ciccolo’s apartment. In an instant-messaging chat with the FBI informant, Ciccolo described the firebombs as “cheap and effective.”

The FBI said that after his arrest, Ciccolo was taken to a local correctional facility and given a routine medical screening. During the examination, he grabbed a pen and stabbed the nurse in the head, the FBI said.