Court records show that a 23-year-old man armed with a knife was looking to commit suicide when he was shot by an officer in north Phoenix.

Phoenix police report that a patrol officer spotted a suspicious person near 33rd Avenue and Deer Valley Road and made contact with 23-year-old Badr Oukaddou.

The officer ordered Oukaddou several times to remove his hands from his pockets, but when Oukaddou refused, the officer removed his gun from its holster.

Oukaddou reportedly asked the officer if that was a gun or a Taser. Oukaddou then allegedly removed a large kitchen knife from his pocket and walked toward the officer with the knife raised over his head. The officer shot Oukaddou, and the man dropped the knife.

Police say Oukaddou later told them that he "wanted to commit suicide by an officer and thought it would be a quick death." He said he was suffering from "undiagnosed depression" that had recently gotten worse since he was unable to enter college and had also lost his job.

Oukaddou is an undocumented immigrant from Morocco who has been living in the United States since 2007. He was arrested on September 11 after being released from the hospital.

He's being held on a $50,000 bond with an immigration hold and has been charged with aggravated assault.