Baril, who police said suffers from schizophrenia and paranoia, was shot multiple times on a bustling midtown Manhattan street.
NYPD Chief of Manhattan Detectives William Aubry said two police officers spotted the suspected attacker near Penn Station on Wednesday morning. He was wearing a mask.
When officers approached him, the man turned around abruptly and began to swing the claw end of a metal hammer, Aubry said. The female officer backtracked and attempted to radio help before falling to the ground. Her partner fired four times, striking the suspect twice.
Police Commissioner William Bratton described as heroic the actions of Officer Geraldo Casaigne, 36, the 12-year veteran who shot the suspect.
"He quite possibly saved his partner's life," the commissioner said.
The other officer, Lauren O'Rourke, a 27-year-old on the job since 2009, was struck with the hammer. She sustained abrasions and lacerations to the back of her head and back, police said.
Casaigne was treated for ringing in his ears. Both officers have been released.
"We believe officer O'Rourke is extremely lucky her partner was able to stop this attack when he did," the commissioner said.
At a news conference, police surveillance video of the attack and shooting was shown to the media.
It happened in mere seconds
"These officers had no chance to call for assistance," Bratton said. "The whole incident took three seconds start to finish."
The suspect was in critical but stable condition at a local hospital, police said. Prosecutors were being consulted about criminal charges. Baril was struck three or four times in the right arm, torso and head area, Aubry said.
Police used facial recognition technology to help identity the suspect from a photo snapped of him entering a subway station after one of Monday's attacks, Aubry said. Baril's photo was distributed to officers at roll call.
Baril has a history of schizophrenia and paranoia, Aubry said. Earlier this year, Baril voluntarily left a mental health facility, officials said.
"From what we're told, when he doesn't take his medication the condition becomes worse," Aubry said.
Baril had eight prior arrests on charges ranging from attempted assault to theft. Baril also had an outstanding warrant in connection with an assault on a worker at a fast-food restaurant.
Aubry said police found a social media post in Baril's name with a drawing of a hammer dripping with blood.
The hammer-wielding suspect was wanted in connection with at least four hammer assaults in Manhattan on Monday, police said.
In the first attack, Baril allegedly shouted profanities at a man near Herald Square before striking him in the head with a hammer. A few hours later, a woman in Manhattan was struck in the head with a hammer by a man yelling profanities.
The third victim was a 28-year-old woman who was sitting on a park bench in Union Square when a man removed a hammer from a bag and struck her in the head, a police statement said. She was taken to a hospital in stable condition.
About 10 minutes later, a 33-year-old woman walking a few blocks from the park suffered a scalp injury after being hit in the back of the head with a hammer, authorities said. She was taken to Lenox Hill Hospital in stable condition.