One of two men charged in connection with last month's home invasion, rape and fatal bludgeoning of a 64-year-old California woman was in the U.S. illegally and on probation, the News-Press has learned.

Victor Aureliano Martinez Ramirez, 29, who is charged along with Jose Fernando Villagomez, 20, in the July 24 attack in Santa Maria, Calif., was on probation for committing battery against an unidentified woman on May 22, 2014, while in possession of methamphetamine. He was charged twice this year for violating probation, once for possessing a concealed knife and the other for drugs, but a Santa Barbara judge allowed him to enter a substance abuse center in Santa Maria in lieu of jail. According to County Jail officials, U.S. Immigration and Customs Enforcement declined to issue an immigration detainer that would have required local authorities to hold him for deportation.

Police say Marilyn Pharis was beaten with a hammer and sexually assaulted in the morning attack, and died later at a local hospital. An autopsy was set for Thursday. 

Ramirez fled, but was tracked from the scene by a police dog to a nearby home, according to authorities.

Ramirez pleaded not guilty to attempted murder, first-degree burglary, and assault with intent to commit rape. Those charges could be upgraded to murder following Pharis' death. He was being held on $1 million bail.

Villagomez was booked Tuesday into Santa Barbara County Jail on suspicion of sexual assault and attempted murder. He was already behind bars after a July 28 arrest over a probation violation.

In May, Villagomez allegedly committed battery against Miguel Angel Romero and was found in possession of methamphetamine. He was sentenced to three years of supervised probation June 17 and was also allowed to enter a drug treatment center in Santa Maria.

Both men will next appear in court on Aug. 13. The autopsy findings could result in murder charges against both.