A man who pointed a gun at an officer inside the Dearborn (MI) Police Department was shot and killed Sunday, authorities said.

According to police, the 33-year-old man, who has been identified as Ali Naji, entered the lobby of the police station around 3:30 p.m. Once inside, he pulled out a concealed handgun and pointed it at an officer behind the desk while standing about 5 feet from the officer. However, the gun malfunctioned.

"The individual attempted to fire the gun at the officer, prompting the officer to discharge multiple rounds that struck the individual," Dearborn Police Chief Issa Shahin told Fox 2.

An investigation is now underway as Michigan State Police try to determine a motive. Police did note that Naji has a history of mental illness.