A Montreal police officer said she feared for her life when a homeless man threatened her and other officers with a hammer, leading her to shoot him to death.

The officer, Jeanne Bureau, had been on the force for two years when the incident with Alain Magloire took place.

She testified at the coroner’s inquest Tuesday that she felt her life was in danger.

Magloire, a 41-year-old homeless man with mental health issues, was shot four times outside the Berri St. bus station in February 2014.

A coroner’s inquest is trying to determine how the situation could have been prevented.

Police constables Bruneau and Alex  Campeau were the first officers to respond to the call regardingMagloire, who had attacked staffers at a nearby hotel moments before.

Bruneau explained to coroner Luc Malouin that she drove up to Magloire to try to talk to him, but he didn't cooperate.

"He pulled a hammer and tried to hit me as I sat in the cruiser.  I pulled out my gun and bent over to avoid him. I was ready to shoot. I yelled at him to drop it," Bruneau testified.

Magloire stepped back, but the constable was shaken.

"I thought I was about to die, that he wanted to kill me," she testified.

Magloire, she said, replied, "You can shoot me, I don't give a damn."

Bruneau continued to pursue Magloire, on foot this time.  She and other colleagues cornered him in front of the bus terminal.

Another officer tried to pepper spray Magloire, but he wasn't close enough. 

Magloire was cornered. 

Witnesses say he challenged police to use their Taser guns. 

Bruneau was about to pull the trigger when another officer arrived in a police cruiser. 

The images suggest Magloire was run over, though Bruneau and her partner claim he jumped on the cruiser's hood before falling down.  

When he still managed to get up, another officer pulled the trigger. 

Magloire was still breathing when he hit the ground. 

Bruneau still handcuffed him. 

The inquiry continues Wednesday.