A Chicago man charged in connection with the deaths of two cops is edging closer Tuesday to being able to secure his release by posting a $200,000 bond, drawing outrage from a police union.

Edward Brown is facing felony charges of reckless discharge of a firearm and aggravated unlawful use of a weapon following the December deaths of officers Conrad Gary and Eduardo Marmolejo. Brown, 24, is accused of firing a gun that prompted both officers to investigate an area of train tracks where they ended up being struck and killed by a commuter train.

“We are planning to post bond this week, yes,” Sharlyn Grace of Chicago Community Bond Fund told FOX32 Chicago. “We're just waiting on a couple more things to come through.”

The fund uses donations to help defendants post bonds and Brown is just $20,000 short of securing his release, according to the station.

“He's hanging in there,” said his attorney, Frank Koustoros. “You know, nobody wants to be in jail, but he's hanging in there.”

POLICE OFFICER DEATHS ON THE RISE IN 2019 AS LOUISIANA COP'S KILLER REMAINS ON THE LOOSE

But the Fraternal Order of Police told FOX32 Chicago it will be shocked and outraged if Brown gets to walk out of jail.

“We are continually disappointed with the Kim Foxx administration when the police are the victims of crime," a spokesman for the union added, referencing the Cook County State Attorney.

At the hearing in December, Assistant State's Attorney Guy Lisuzzo said Brown had gotten off a train traveling from his job in downtown Chicago to the South Side where he lived, and during his walk home Brown ducked into an alley to urinate.

"The defendant noticed that there was a black fanny pack laying near the garbage cans," Lisuzzo said. Brown looked inside and found a handgun, magazines and ammunition. He then tossed the fanny pack and took the gun home.

Lisuzzo said Brown later took the handgun to the tracks to shoot it.

Chicago Police Officers Conrad Gary, left, and Eduardo Marmolejo were struck by a train. (AP)

Kostouros said his client never should have taken the gun, but told the judge that by bringing it to the area of the tracks on the far South Side, "he thought he was doing something safe."

Prosecutors said Brown fired the gun twice — first into the air and then in the direction of a school that was not in session. Nobody reported the shots to police but the sound was picked up by a ShotSpotter sensor that alerts police when it detects the sound of gunfire.

Officers Gary and Marmolejo were dispatched to the area to investigate. When they arrived, according to prosecutors, Brown saw them and ran back up an embankment he had just walked down. It's not clear if the officers ever saw him as they went onto the tracks to get a better look around. Moments later, two trains passed each other at the spot where they stood.

MINNESOTA OFFICER WOUNDED, K-9 KILLED IN SHOOTOUT WITH SUSPECT

Video recovered from Marmolejo's body camera, police said, showed the officers were looking toward a northbound train when they were struck by a southbound train they hadn't noticed.

"They must have thought the sound they heard was the northbound train (and) they must have missed the sound of the train right behind them," Chicago police spokesman Anthony Guglielmi said.

Other officers spotted Brown a short time later. Brown was immediately cooperative, prosecutors and police said, and without hesitation admitted that he was carrying the gun he'd found and that he had just fired it. He was arrested and, on the way back to the station, the officers and Brown learned that Gary and Marmolejo had been killed.

CLICK HERE TO GET THE FOX NEWS APP

Because prosecutors said he was committing a crime when he fired the gun, there was a question about whether he would be charged with murder as has happened to people whose crimes are believed to have led to someone's death. Such charges were filed against a 19-year-old in Alabama in December, the Associated Press reported, after he allegedly fired a gun that prompted a girl to run into a street where she was struck by a hit-and-run driver.

Brown faces up to three years in prison, if convicted.

The Associated Press contributed to this report.