DALLAS—The man suspected of setting fire to a Texas mosque believed that its worshippers were terrorists hiding weapons there, according to law enforcement and federal prosecutors, parroting right-wing beliefs that American Muslims are secretly connected to ISIS and other terror groups.

Marq Vincent Perez wrote on Facebook that he believed Muslims might “go underground” as a result of increased scrutiny in recent months, prompting him to allegedly burglarize and set fire to the Victoria Islamic Center in an attempt to out members of the mosque as terrorists. Calling them “rag heads” and “towel heads,” Perez also believed that Muslims marry children and that he was protecting his community by burning the mosque, according to law enforcement.

Perez’s alleged actions are the opposite of what President Donald Trump described as a candidate as hesitance to report the San Bernardino attackers, who he wrongly claimed had “bombs all over the apartment” that were seen by neighbors. As a presidential candidate, Trump said that action wasn’t taken because “everyone wants to be politically correct, and that’s part of the problem that we have with this country.”

Perez spoke about Trump on Facebook prior to burning the mosque.

“Hard to track them and know what they’ll do since Trump is claiming to send them all packing,” Perez said in a thread about his disdain for Muslims. “[Hard to know] how to know how many will go underground or be hid by [Democrats].”

It was these concerns that prompted Perez to spring into action on Jan. 28, allegedly burglarizing the mosque for the second time in days and burning it to the ground.

The sole suspect in the fire, Perez was in court on Thursday on an unrelated case in which he is accused of planning to set fire to a car owned by a neighbor with whom he was having a dispute. That plan and his alleged burning of the mosque were used by prosecutors to argue that Perez be held without bond. The hearing marked the first time that the suspect in the mosque fire has been named, and the only time a motive for the arson has been put forward

In the Facebook thread cited by prosecutors, Perez and another person who is referred to as a confidential informant in a recording of ATF agent Rick Miller’s testimony obtained by the Victoria Advocate, also discussed security at the mosque.

“It tells me that he’s spent some time watching this mosque,” Miller testified of Perez’s comments.

So far, Perez has only been charged with possessing a destructive device—several large firecrackers taped together that he allegedly intended to use to set fire to the neighbor’s car—but Thursday’s hearing indicates Perez will eventually be charged with setting fire to the mosque.

Judge Janice Ellington noted that Perez’s “involvement in a hate crime that is presently being investigated,” along with the loaded guns found in the home where he lives with an infant and a toddler were enough reason to deny him bond, and sent him back to the custody of the U.S. Marshals.

Perez apparently believed that members of the Islamic Center were associated with ISIS or other terrorist groups, Miller testified. Two confidential informants are cited as confirming Perez’s anti-Muslim beliefs.

One informant told ATF agents that Perez had said he “hated Muslims.” Perez described Muslims as “towel heads” or “rag heads,” according to the source. One of the confidential informants “indicated that [Perez] was upset that Muslim people were allowed to marry children,” Miller testified.

“Mr. Perez stated that he believed that members of the mosque were involved with ISIS and that they were terrorists. He […] broke into the mosque to see if people who go to the mosque were hiding weapons because he believed they were terrorists.”

That confidential informant was with Perez on the night of the fire.

After stealing an electrical meter, a laptop, cell phones, and unidentified personal items, Perez lit a fire inside the mosque, the informant told Miller. Perez then told the informant that “he had done something in the mosque and that soon everyone would know about it,” Miller testified.

Just two gold domes were spared by the blaze. Members of the mosque saved them in the hopes they can be used when the mosque is rebuilt, Abe Ajrami told The Daily Beast a week after the fire.

Perez appears to believe he was protecting his community by burning the mosque, writing on Facebook that “Everyone lives in a bliss of ignorance, that war never comes to us, that only us soldiers, tired and forgotten, are the only ones armed and ready,” according to prosecutors.

Perez served in the military for five weeks, Miller noted in his testimony. Perez claims on his Facebook page to have served in the U.S. Air Force, which did not immediately respond to a request to confirm Perez’s service.

In the Facebook thread, Perez promised that “it’s going to be bad” if weapons were found at the mosque.

“I have plans ready,” Perez wrote. “The hardest part is getting the town to believe the evidence.”