NEW YORK — Two New York City women have been arrested in an alleged conspiracy to build a bomb and wage a “terrorist attack” in the United States, according to a federal criminal complaint made public on Thursday.

Noelle Velentzas, 28, and Asia Siddiqui, 31, devised a plot to target police, government or military targets based on their “violent jihadist beliefs,” according to the complaint filed in U.S. District Court in Brooklyn.

The two women, who were roommates in the city borough of Queens, researched how to build an explosive device and plotted to attack a military base or police funeral, it stated.

Charged with conspiracy to use weapons of mass destruction against persons or property in the United States, they were slated to appear before U.S. Magistrate Judge Viktor Pohorelsky Thursday afternoon.

If convicted, they face the possibility of life in prison.

Velentzas praised al-Qaida’s Sept. 11 attacks on the U.S., considered former al-Qaida chief Osama bin Laden a hero and said she and Siddiqui were “citizens of the Islamic State,” the complaint said.

The women also voiced support for beheadings of Western journalists and others by Islamic State, the militant group that controls territory in Syria and Iraq, the complaint said.

Since last summer, they read textbooks on electricity, watched online videos about soldering and read “The Anarchist Cookbook,” a book with instructions on building homemade explosives, it said.

They looked for supplies such as wiring and chemicals in a pharmacy and a Home Depot store, it said.

“We are committed to doing everything in our ability to detect, disrupt and deter attacks by homegrown violent extremists,” Brooklyn U.S. Attorney Loretta Lynch, who is President Barack Obama’s nominee for U.S. attorney general, said in a statement.

“We remain firm in our resolve to hold accountable anyone who would seek to terrorize the American people,” she said.

Also on Thursday, Muhanad Mahmoud Al Farekh, a U.S. citizen who trained with al-Qaida in Pakistan, appeared in Brooklyn federal court on charges of conspiracy to provide material support to terrorists.

The FBI said Farekh, who had been deported from Pakistan to the U.S. and arrested, conspired to provide personnel to be used by the Islamist militant group in support of efforts to kill U.S. citizens and members of the U.S. military abroad.