The suspect previously posted about Democrats to social media, sources said.
The suspect accused of arson at Pennsylvania Governor Josh Shapiro's mansion arrived for his arraignment on Monday evening.
Cody Balmer, 38, was silent as he was brought from a Pennsylvania State Police car into the courthouse.
Wearing a beige/green sweatshirt with a hospital bracelet on his right wrist, handcuffed, shackled at the waist, Balmer stuck his tongue out at one reporter who asked why he did his alleged crime.
Balmer sat at the defense table, nearly motionless. Asked if he understood the eight counts against him, including attempted homicide, terrorism and aggravated arson, Balmer replied, "Yes ma'am."
When Judge Dale Klein asked whether Balmer suffered from mental illness, he replied, "That's the rumor, but no ma'am."
His attorney said Balmer is indigent and asked for a "reasonable monetary bail," but the judge denied bail, saying that while appreciating that Balmer turned himself in, there were no conditions that could keep him from being a danger to the community.
When the judge announced that she was denying bail, Balmer said, "Thank you, ma'am."
Balmer was arrested on Sunday. Sources said he is a mechanic who had previously expressed disdain for Democrats on social media.
Shapiro and his family were in the residence at the time of the fire, which was reported at about 2 a.m. Sunday. They were evacuated safely and were not injured, according to state police.
Balmer allegedly made two Molotov cocktails from Heineken bottles he had at home and threw them inside the governor's mansion after breaking a window with a hammer, according to court documents.
A series of photos released by the Pennsylvania State Police from inside the governor's residence showed extensive fire damage to a room next to where Shapiro said he and his family hosted guests for a Passover Seder on Saturday night.
Damage captured by the images included a soot-covered chandelier dangling from the charred ceiling and singed walls, a blackened carpeted floor, melted and broken tables, a burned sofa and a heavily damaged grand piano.
PHOTOS: Fire damage at residence of Pennsylvania Gov. Josh Shapiro
The suspect arrested in the firebombing allegedly carried out a "domestic terrorism incident" that put the governor, his family and firefighters at risk, Harrisburg Fire Chief Brian Enterline said Monday.
Enterline said the governor's mansion does not have fire suppression equipment, but alarms were blaring when firefighters arrived on the scene.
The fire chief described it as "surreal" to see fire shooting from the governor's residence. He said firefighters had to cut parts of the gates to stretch hose lines inside. It took about a half hour to get the fire under control, he said. He added that there had never been a fire drill conducted at the governor's mansion.
Luckily, the door from the main dining room was closed at the time of the blaze, keeping the fire from spreading into the living quarters. Had the door not been closed, Enterline said Shapiro and his family would no doubt have been at risk.
After turning himself in, Balmer allegedly told police he would have attacked Shapiro with the hammer if he happened to see the governor inside the residence, the documents said.
RELATED: What we know about the man charged with setting Pennsylvania Gov. Josh Shapiro's residence on fire
Investigators said they recovered items at Balmer's home matching those used in the attack.
Chardo said state troopers recovered a "unique Snap-On jacket with the distinctive shoulder patches and a bag containing a gasoline container."
During a meeting at the White House on Monday with El Salvador President Nayib Bukele, President Donald Trump was asked by a reporter if he had been informed of a motive in the Pennsylvania arson attack.
"The attacker was not a fan of Trump I understand just from what I've read and from what I've been told," said Trump, adding that he was not informed of the motive in the incident. "The attacker basically wasn't a fan of anybody's. Probably just a whack job. And certainly a thing like that cannot be allowed to happen."
Charges filed on Sunday against Balmer include attempted murder, terrorism, aggravated arson and aggravated assault against an enumerated person.
State Police said the suspect was in a hospital Monday morning for a "medical event" that was not described. He was later released to attend his arraignment.
Chardo released a statement Monday morning saying Balmer allegedly admitted that he committed the attack.
Sources familiar with Balmer said his public grievances with the Democratic Party were primarily related to financial issues.
Investigators are also digging into records to determine whether Balmer may have been experiencing financial problems, the sources said.
Shapiro said during the press conference that the attack was "targeted."
"We do know that this attack was targeted ... this type of violence is not OK," the governor said. "And I don't give a damn if it's coming from one particular side or the other, directed at one particular party or another," he added.
Just hours before the fire, the Pennsylvania governor had posted a picture of his family's Passover Seder table on X, writing, "From the Shapiro family's Seder table to yours, happy Passover and Chag Pesach Sameach!"
Shapiro addressed the possible motive during the conference, saying of the suspect, "If he was trying to terrorize my family, my friends... hear me on this, we celebrated our faith proudly, no one will deter me from celebrating my faith openly and proudly."
Investigators have not ruled out Shapiro's Jewish faith as a possible motivating factor, sources told ABC News. They are also not ruling out the possibility the suspect had mental health issues, sources added.
Pennsylvania State Police Lt. Col. George Bivens detailed the alleged attack, saying the suspect came over a fence and actively evaded troopers while they were searching for him on the property.
While they were searching, the suspect broke in and set the fires, according to Bivens, who said the incident played out "over a period of several minutes."
The part of the fence Balmer allegedly hopped to get inside the residence was sliced off by investigators so they could test it for DNA, sources familiar told ABC News.
Earlier Sunday, Shapiro said in a statement, "My family and I woke up to bangs on the door from the Pennsylvania State Police after an arsonist set fire to the Governor's Residence in Harrisburg. The Harrisburg Bureau of Fire was on the scene and while they worked to put out the fire, we were evacuated from the Residence safely by Pennsylvania State Police and assisted by Capitol Police."
"Thank God no one was injured and the fire was extinguished," he added.
The state police said that while the investigation is continuing, "the State Police is prepared to say at this time that this was an act of arson."
The fire caused "a significant amount of damage" to part of the residence, according to state police.
Shapiro was elected Pennsylvania governor in 2022 and was considered as a candidate for vice president for 2024 Democratic presidential candidate Kamala Harris before she eventually chose Minnesota Gov. Tim Walz. Shapiro served two terms as the state's attorney general before being elected governor.
ABC News contributed to this report.