A man who tried to carjack undercover police officers in Kentucky's largest city was fatally shot by a Louisville Metro Police officer, authorities said.

The shooting happened Monday afternoon as two undercover officers were inside a vehicle and trying to catch a suspect in an unrelated investigation when they were approached by a man in his 20s armed with a gun who attempted to carjack them, Interim Police Chief Jackie Gwinn-Villaroel told news outlets.

KENTUCKY SCHOOL SETTLES OVER COMPLAINTS OF WIDESPREAD HARASSMENT OF BLACK, MULTIRACIAL STUDENTS

Kentucky Fox News graphic

A Kentucky man who was trying to carjack undercover police officers was fatally shot Monday afternoon. 

CLICK HERE TO GET THE FOX NEWS APP

One of the officers shot the man with his service weapon and both officers provided medical aid, Gwinn-Villaroel said, but the suspect died from his injuries.

The shooting will be investigated by Kentucky State Police, said Gwinn-Villaroel.

Kentucky State Police said in a statement that a critical response team was sent to the scene and the investigation is ongoing.