Bail was set at $750,000 Saturday for the father of a 3-year-old boy who was shot in the head with his mother’s gun in their Englewood home.

The order was handed down by Judge James Brown after Michael Riley’s son was shot in their home in the 6200 block of South Aberdeen just before 5 p.m. Thursday.

Riley, 34, was charged Friday with one felony count of unlawful use of a weapon by a felon, one felony count of possession of a controlled substance and four misdemeanor counts of child endangerment, according to Chicago Police and the Cook County State’s Attorney’s office.

Assistant Cook County State’s Attorney Amari Dawson said the boy and three of his siblings were left unsupervised in the home in the 6200 block of South Aberdeen about 3:40 p.m.

While playing cops and robbers, the boy’s 11-year-old sister found an unlocked lockbox that contained a loaded semi-automatic .40 caliber handgun, Dawson said. The gun was legally bought and owned by the children’s mother, Gwendollyn Holloway, who has a valid Firearm Owner’s Identification card.

“The boy reentered the living room and the gun went off, and the boy was struck in the head in the right temple area,” Dawson said.

Prosecutors and Riley’s attorney did not specify if anyone was handling the gun when the boy was shot. He was taken to Comer Children’s Hospital, where he remained in critical condition Saturday, according to Dawson.

Riley’s attorney told reporters the boy’s condition has improved since his surgery.

“Right now, it’s the best possible situation,” Nicholas Economakos said. “It looks like the child is going to be OK.”

The apartment the children were left in was squalid, Dawson said.

“It was littered with clothes, garbage, debris and dirty dishes,” Dawson said. “The children’s bedrooms contained soiled mattresses on the floor without sheets or blankets and were surrounded by garbage and clothes.”

Fifty baggies containing what Riley admitted to be about 26 grams of crack cocaine was found in the bedroom he shares with Holloway, who was charged with four misdemeanor counts of child endangerment.

Riley has previous drug convictions and a pending misdemeanor aggravated assault case from earlier this year, according to court records.

The apartment also did not have working heat at the time time the boy was shot. Investigators found the oven on with its door open being used to heat the home.

Economakos, who is representing both Riley and Holloway, said the furnace had broken less than two days before the boy was shot and was in the process of being repaired, and the drugs were not in proximity to any of the children.

“These weren’t conditions that were going on for weeks or months,” said Economakos, adding that a neighbor “was supposed to be watching the children at the time” of the shooting.

Riley and Holloway — who was no longer in police custody Saturday afternoon — have been together for 14 years and have five children, Economakos said.

“We believe the evidence will eventually show that they didn’t do anything that was negligent or terrible or put their children in a dangerous situation,” he said. “Unfortunately, sometimes things like this happen.”

DCFS is also investigating the shooting, according to the agency, and both parents are being investigated for allegations of neglect.

“DCFS has had prior contact with this family, including an indicated finding against the father for neglect in 2009, and two indicated findings against the mother for neglect in February 2013 and March 2013,” the statement from the agency said.

Their oldest child, 12, suffers from cerebral palsy and was taken into DCFS custody in 2013.

Riley, who has previous drug convictions and a pending misdemeanor aggravated assault case from earlier this year, according to court records, was also barred from seeing any of his children.