Police continued to search Saturday for the suspect who fatally shot Cook County Judge Raymond Myles as a connection between the alleged getaway-car driver in the crime and Myles’ girlfriend — who survived the botched holdup outside Myles’ home — emerged.

Joshua Smith, the alleged getaway driver, is related to the ex-husband of Myles’ girlfriend, sources told the Chicago Sun-Times. The Chicago Tribune first reported the development late Friday.

Myles’ girlfriend filed for divorce from her husband in 2015, court records show. The exact relationship between Smith and the ex-husband was not known.

JUDGE MYLES: Tough love and justice dispensed in his courtroom

Myles’ girlfriend’s ex-husband did not respond to requests for comment Saturday. Myles’ girlfriend’s divorce attorney also could not be reached.

Cook County Associate Judge Raymond Myles was shot and killed April 10. | Cook County Circuit Court photo

Messages left with the Cook County state’s attorney’s office were not returned.

At Smith’s bond hearing earlier this week, prosecutors said he drove the shooter to Myles’ home in the West Chesterfield neighborhood before dawn Monday with the intention of robbing the judge’s girlfriend as she went to the gym. The shooter had followed her for weeks to learn her schedule, authorities said.

About 5 a.m., the man crept up on the woman as she left Myles’ house; he took her gym bag and shot her in the leg.

Hearing the gunshot, Myles came out of the house and confronted the gunman, who shot Myles four times, killing the 66-year-old judge, prosecutors said.

Judge Robert Miller, a DuPage County judge appointed to preside at the hearing, ordered Smith held without bail on charges of first-degree murder, aggravated battery and obstructing police.

Joshua Smith | Chicago Police photo

Smith’s unnamed accomplice, who remains at large, “grew upset” as he rifled through the bag and couldn’t find anything, according to prosecutors. The man eventually tossed the bag from the car window and into a trash can.

Police on Wednesday said the shootings had nothing to do with Myles’ position as a judge.

Court records show the judge’s girlfriend, 52, filed for divorce from her ex-husband, 74, on Feb. 18. A week later, a judge found in her favor.

Six months later, her ex-husband filed for an emergency order of protection against her, which a judge granted. The order was vacated a month later, court records show.

Contributing: Sam Charles