CNN  — 

Two suspects are in custody and have been charged in the ambush shooting of a Baltimore police officer who was sitting in her patrol car, authorities said.

The two suspects were charged with attempted murder in the shooting of Baltimore Police Officer Keona Holley, Police Commissioner Michael Harrison announced in a news conference. Holley’s medical condition is considered critical but stable, he said.

The suspects are also charged with murder in the death of Justin Johnson, who was shot in a residence not far from where Holley was attacked.

Travon Shaw, left, and Elliot Knox.

Harrison identified the suspects as Elliot Knox, 31, and Travon Shaw, 32. Harrison said both suspects confessed to the crimes, but he does not know their motive.

“What we now know is that both shootings are related,” Harrison said. “As we now know the perpetrators of Officer Holly’s shooting, they then left that scene, went to Lucia Avenue and then committed that homicide of Justin Johnson.”

CNN has been unable to determine if Knox and Shaw have obtained legal counsel.

“Our investigators were able to locate and recover two weapons believed to have been used in both incidents, one of which has been confirmed to have been used in both incidents,” Harrison said.

While investigators were processing the scene of Holley’s shooting, another homicide occurred not far from that location, Harrison said.

He said that through video cameras and canvassing they were able to locate a vehicle of interest that police believed was linked to Holley’s shooting.

Following the recovery of the vehicle, investigators learned the identity of a person they wished to question, located that person and interviewed him, Harrison said.

“Additionally, investigators learned the identity of a second person of interest, and we were able to take him into custody also.”

State Attorney Marilyn Mosby, who also attended the news conference, said she would seek justice for the victims’ families.

“We will have zero tolerance for those who seek to use violence and murder to settle their grievances. And the criminals that do will be prosecuted to the fullest extent of the law,” she said.

“As officer Holley continues to fight and fight for her life, we vow to her, her family, her colleagues, this community that we will get justice on her behalf – for every victim that has been affected by these heinous acts of violence, we will get justice on their behalf.”

Mayor Brandon Scott thanked law enforcement for their swift action in apprehending the suspects.

“Despite the risk, knowing her city, she joined the Baltimore Police Department because she wanted to make a difference in her city and her community. She wanted to protect and serve her community,” he said.

CNN previously reported Officer Holley was shot while sitting in her patrol car around 1:30 a.m. Thursday.

Harrison said the assailant “apparently walked up somewhere from the rear of the (police) vehicle or alongside the vehicle and began firing into the vehicle striking our officer.”

The officer then accelerated the patrol vehicle and crashed, officials said.

The Baltimore Police Department had announced a $59,000 reward for information on the shooting.