RICHMOND, Ky. — A central Kentucky police officer died early Friday, two days after he was ambushed and shot in the head while searching an apartment for a robbery suspect, authorities said.

Richmond Police Officer Daniel Ellis, 33, died at the University of Kentucky Medical Center in Lexington, State Police Trooper Robert Purdy said in a written statement. The suspect, 34-year-old Raleigh Sizemore Jr., is an ex-convict who had absconded parole, according to state corrections records.

This booking photo released by the Madison County Detention Center shows Raleigh Sizemore, 34. Madison County Detention Center via AP

"It's just heartbreaking," Richmond Mayor Jim Barnes told The Associated Press. "It's an emotional time for everyone in the community. Those guys work so hard to protect the city."

Ellis, a seven-year veteran of the force, had remained hospitalized following the Wednesday shooting.

He leaves behind a wife and 4-year-old son, police said. Ellis' police cruiser, parked in front of the police department, has become a memorial for people to pay their respects.

"It's packed with flowers," said Richmond Police Major Steve Gregg. "People are driving by and telling us how sorry they are and that we have their support. That means a lot to us."

Ellis was a well-liked officer who was in line for a promotion to detective, he said.

"We're a very close department," Gregg said. "You work together every day and we're a really close-knit group of people here. It's like losing a brother."

Authorities said Ellis and another officer went to an apartment Wednesday searching for a man who tried to mug a woman in the parking lot of a downtown gas station.

Police said the Sizemore opened fire on Ellis. The second officer returned fire and struck Sizemore, who was treated at the hospital and released to police custody.

Sizemore was charged Wednesday with attempted murder of a police officer and unlawful imprisonment first degree.

Two others in the apartment during the shootout were also arrested. Gregory Ratliff, 25, was charged with complicity to commit murder, and Rita Creech, 44, was booked with robbery in the first degree.

All three are being held at the Madison County Detention Center.

The shooting happened at Ratliff's apartment, about a mile from the gas station, according to the police report.

Sizemore allegedly told Ratliff he did not intend to go back to prison and warned "not to let them in or he would shoot him," the report says. Sizemore then led Creech to a bedroom in the back of the apartment with a gun in his hand, the report says.

Ratliff let Ellis into the apartment and allowed him to search, but said no one else was there and there were no weapons in the home, according to the report.

The report alleges that Sizemore shot Ellis in the head "as soon as he began to cross the threshold of the bedroom door."

The mayor said people in Richmond, which has a population of about 32,000, had already been talking about raising money for Ellis' family while he was hospitalized. Barnes said he's also concerned with how to better protect police officers.