A gunman has killed a police officer and two women in a shooting at a hospital in Chicago.

The gunman opened fire on his former partner, 38-year-old Tamara O'Neal, in the car park outside - she was an ER doctor at the hospital.

When officers surrounded the man, named in media reports as 32-year-old Juan Lopez, he ran into the hospital and opened fire again, where he shot and killed a pharmaceutical assistant as she stepped out of a lift.

Hospital officials say she was 25-year-old Dayna Less, who was in training to become a pharmacist.

The police officer, Samuel Jimenez, was also killed inside the hospital.

He was a 28-year-old father of three.

Image: Dayna Less was training to be a pharmacist. Pic: Facebook

Chicago Police Superintendent Eddie T Johnson said Mr Jimenez joined the force in February 2017 and had recently completed probationary training and became an officer.

"What I would ask is that you keep all the victims of today's horrific incident in your thoughts and prayers," Superintendent Johnson said.

Lopez was killed inside, but it is unclear if he shot himself or was shot by police.

Image: The body of Samuel Jimenez was escorted to the Medical Examiner Office

Ms O'Neal and the gunman had reportedly planned to get married on 27 October, but she called off the wedding in September.

Officers responded after reports of shots fired inside and outside Mercy Hospital on the city's South Side.

One witness says he saw a gunman repeatedly shoot a woman outside the hospital before making his way inside and opening fire.

A person was taken away in a police-escorted ambulance in Chicago

James Gray told KABC-TV he was inside when the shooting unfolded. He described the scene as "mass chaos".

Mr Gray says the man was walking with a woman near a parking area when he turned and shot her in the chest multiple times.

He says the man then stood over the woman and continued shooting.

Image: Police and firefighters follow the ambulance carrying the remains Samuel Jimenez

They were not having a heated discussion, he said.

He added the man then entered the hospital, and "just started shooting at random".

The hospital was partially evacuated.

Image: The shooting in Chicago happened this afternoon

Footage from the scene showed one person being taken by emergency services into an ambulance.

Television footage showed several people, including hospital staff, walking through a car park with their arms up.

Witness Tracy Lyons, who was leaving the hospital after radiation treatment for cancer, said: "I was walking to the car and I had to fall to my knees it started instantly, like a gun battle... Thank you Jesus. It was nobody but God [that protected us]... And my heart goes out to the ones who lost their lives.

Image: Chicago firefighters and police officers lined up outside of the Cook County Medical Examiner's office waiting for the remains of Samuel Jimenez

"I believe if I had turned that corner I would have got hit."

She said there had to be "over 30 shots" fired in total.

There was a second shooting incident shortly after in Denver, which left one person dead and three others with non-life threatening injuries.