Judge Raymond Myles was killed early Monday morning after a gunman robbed his girlfriend.

Story highlights

Gunman had been watching judge's girlfriend for weeks, authorities say

Prosecutor's spokeswoman says suspected getaway driver confessed

CNN  — 

The man who authorities say drove the getaway car after a Cook County judge was gunned down outside his Chicago home will remain in jail.

Police are still looking for the gunman who killed Judge Raymond Myles and wounded his girlfriend early Monday morning before the couple left the house to go to a gym.

Joshua Smith, 37, was formally charged Thursday with first-degree murder, aggravated battery and obstruction. He was denied bail.

He confessed to his role in the shooting, Cook County State Attorney spokeswoman Tandra Simonton told CNN.

Joshua Smith

Cook County Public Defender Kristina Yi represented Smith in court, CNN affiliate WBBM reported.

“The death of Judge Myles is tragic loss for family, friends, community,” Yi said, according to the station.

CNN was unable to reach Yi for comment.

Girlfriend was the target

Myles’ 52-year-old girlfriend, who has not been publicly identified, was leaving the house Monday when a man took her gym bag and shot her in the leg.

Simonton said the second suspect had been watching the girlfriend for weeks and wanted the bag.

Myles, 66, heard the commotion and confronted the gunman, police have said. He was shot four times.

The suspects fled with the gym bag, which they tossed away after discovering it contained no money, Simonton said.

A judge from DuPage County presided over Thursday’s hearing. Colleagues of Myles came to the hearing; some hugged and cried after court was done. Purple bunting was hung on several windows near the entrance to the courthouse.

Video from CNN affiliate WLS showed people identified as Smith’s relatives leaving without commenting.

Smith’s next court date is May 1.

Misty Marris, a defense attorney not affiliated with the case, told HLN’s “Primetime Justice” that you don’t have to be the shooter to be charged with serious crimes.

“It’s classic accomplice liability,” Marris said. “If you’re involved in the planning, commission or the getaway of a crime, you can be charged with that murder.”