A gunman who killed his three daughters and another man in a church in Northern California was in the U.S. illegally, and had not been handed over to Immigration and Customs Enforcement (ICE) after a prior arrest due to California’s "sanctuary state" law that limits cooperation with federal immigration enforcement, authorities said Friday.

The Sacramento County Sheriff’s Office said that David Fidel Mora-Rojas was in the country illegally and was arrested on Feb. 23 for driving under the influence, assaulting an officer and medical staff. 

COURT DOCUMENTS SHOW ABUSE BEFORE CALIFORNIA CHURCH SHOOTING

ICE issued a detainer -- a request that the suspect be held until the agency can transfer him into custody and put him into deportation proceedings. However, due to California’s "sanctuary state" law, authorities say they were barred from holding him or communicating with ICE about his release and he left on bail on a $15,000 bond.

Court documents paint a disturbing picture of verbal and physical abuse inflicted by 39-year-old David Mora on his girlfriend, who is the mother of their three daughters, one of whom would have turned 11 on Wednesday. (Merced County Sheriff's Office via AP)

Court documents paint a disturbing picture of verbal and physical abuse inflicted by 39-year-old David Mora on his girlfriend, who is the mother of their three daughters, one of whom would have turned 11 on Wednesday. (Merced County Sheriff's Office via AP)

This week, authorities say Mora shot his daughters, 9, 10 and 13, and an adult chaperone supervising the visit in the Church of Sacramento, before turning the gun on himself. He had been free for five days.

Mora had been living in the church on a mental health hold after April last year, where he threatened to hurt himself and his wife. He was also barred from owning a gun under a restraining order, but was armed with an unregistered, homemade semiautomatic.

ICE did not respond to Fox News Digital's request for comment, but the agency told The Associated Press that Mora, a Mexican national, had overstayed his visa and was therefore in the country illegally. He arrived in the U.S. legally in 2018.

CALIFORNIA SHOOTING SUSPECT ARRESTED FOLLOWING MANHUNT, SHELTER-IN-PLACE ORDER, AUTHORITIES SAY

The case is likely to raise further scrutiny of "sanctuary" laws that have emerged in cities and states across the country. Defenders of such laws, which limit cooperation with immigration enforcement, claim that they encourage otherwise law-abiding illegal immigrants to cooperate with law enforcement. Critics of the laws question whether that benefit outweighs the risk and consequences caused by releasing illegal immigrant criminals who could otherwise be deported out onto the streets.

"This unspeakable tragedy highlights the true cost, unintended or not, of sanctuary policies that prevent law enforcement from protecting its citizens", said Sheriff Scott Jones in a statement. Jones is running for Congress as a Republican.

The Biden administration has significantly narrowed ICE’s priorities for arrest and deportation, down to just three categories: recent border crossers, national security threats and "aggravated felons." 

CLICK HERE TO GET THE FOX NEWS APP

An ICE spokesperson recently confirmed to Fox News that it issues detainers for immigrants it suspects are "removable non-citizens" – meaning those who fit into those three categories. This would suggest the agency believed Mora did fit into those priorities.

The Associated Press contributed to this report.