FALMOUTH — Barnstable police Officer Anson Moore got the call Friday evening that every parent dreads.
His son, Officer Ryan Moore, called from a house on Ashley Drive in Falmouth, where he’d been shot in a confrontation with a 21-year-old man. Gunfire also struck his fellow Falmouth officer, Donald DeMiranda, who was probably saved by his vest after being hit in the chest and clavicle.
Friday, said Anson Moore, “could have been the worst night of my life.’’
But his son walked away from the violent confrontation with a graze wound to his neck. He was treated and released from Falmouth Hospital.
“My word of the day is ‘grateful.’ It came down to a matter of inches,’’ Anson Moore said in an interview Saturday.
Across Falmouth, residents expressed relief and gratitude on Saturday that DeMiranda and Moore survived the shootout with Malik Antonio Koval, who allegedly took cover inside a Colonial-style home Friday evening and shot at the officers with a .40-caliber firearm, said Cape and Islands District Attorney Michael O’Keefe.
“It’s a sad commentary that the police are grateful when they’ve been shot and that nobody is dead,’’ O’Keefe said in a telephone interview Saturday.
A third officer injured his hip while trying to scale a fence behind the home on Ashley Drive, according to Falmouth Police Chief Edward Dunne. He is recovering at home.
Moore and DeMiranda were summoned to the neighborhood at 5:25 p.m. Friday after police received a report of a disturbance and encountered Koval breaking bottles on Seacoast Shores Boulevard, a nearby street, O’Keefe said.
When the officers approached Koval, he became agitated and ran into the home on Ashley Drive, prosecutors said. His brother, Marcus Maseda, 18, and mother, Kimberly M. Koval, 38, tried to block Moore and DeMiranda as they followed Koval, according to Dunne.
Koval then began shooting at the officers, prompting them to return fire, O’Keefe said.
Koval was shot and taken to Brigham and Women’s Hospital in Boston, where he was in stable condition on Saturday, prosecutors said.
On Friday, O’Keefe said Koval will face multiple counts of assault and battery with a dangerous weapon, in addition to other criminal charges.
Maseda and Kimberly Koval were also arrested and charged with obstruction of justice, assault and battery on a police officer, and interfering with the duties of a police officer, prosecutors said. They were released on $5,000 bail, O’Keefe said.
He and Dunne declined to say whether Malik Koval had been involved with the criminal justice system prior to the confrontation. Koval’s relatives couldn’t be reached Saturday.
One of Koval’s neighbors struck an empathetic tone.
“I almost feel bad for the kid,’’ said the neighbor, Michelle Jurss, 48. “He’s not well, went crazy, got shot four times, and now people are like, ‘String him up!’ If he’s mentally ill, you’ve got to have some compassion.’’
The shooting occurred less than two weeks after Weymouth police Sergeant Michael Chesna, 42, was shot to death by a suspect while responding to a report of an erratic driver.
In April, Yarmouth police Sergeant Sean Gannon, 32, was fatally shot when he was serving a warrant at a residence in Marstons Mills, a village of Barnstable.
In each of those cases, a suspect was charged with first-degree murder.
James Machado, the executive director of the Massachusetts Police Association and a Fall River police sergeant, said the recent violence is the worst the state has seen since the early 1990s, when several officers were killed in a string of incidents. Among the victims were state Trooper Mark Charbonnier and Fall River Officer Thomas Giunta.
“I think a lot of officers feel that much of the hate comes from social media, where it’s almost become OK to hate the police,’’ Machado said. “It’s sad to think that society has come to that.’’
Dunne said Falmouth officers were being inundated with messages of support.
“We’ve received numerous well wishes, expressions of love, support, gifts, food, coffee, and, of course, countless thoughts and prayers,’’ he said. “We are thankful we are able to serve such a supportive community.’’
Joe Ledwick, 9, who lives in West Falmouth, organized a lemonade stand after learning about the shooting. He sold lemonade for $1 a cup with the proceeds going to Falmouth police.
“I was really terrified when I heard,’’ said Ledwick, whose lemonade stand was visited by Dunne. “Then I heard [the officers] were going to be OK, and that calmed me down.’’
DeMiranda was recovering Saturday at a Boston hospital, according to Amilcar Vicente, his brother-in-law.
“He was a good guy before he was a cop, and he is a good person as a cop,’’ he said.
In the East Falmouth neighborhood where DeMiranda lives, his next-door neighbor said she’s grateful to have him living nearby.
“We always feel safe that he’s next door to us,’’ said Maryellen Swain, the neighbor. “Falmouth is a wonderful place, but like any place, we have our problems.’’
DeMiranda joined the force in March 2015. Moore has been an officer for nearly six years, according to his father, who let his son accompany him on patrol when he was a boy.
Ryan Moore was among three Falmouth officers honored in 2015 for their actions at a homicide scene in Bourne, where a Bourne police officer was shot by a suspect armed with a rifle, according to the Falmouth Police Department Facebook page.
Both injured officers were recognized by Falmouth police as Officer of the Month in 2018. DeMiranda received the honor in April and in August 2017, according to the department’s Facebook page. Ryan Moore, who is the police liaison for the East Falmouth Village Association, was recognized in January.
“He loves his job,’’ Anson Moore said of his son. “He’s a good-hearted guy, and he takes the job seriously.’’
Globe correspondents Jeremy C. Fox and Lucas Phillips contributed to this report. Laura Crimaldi can be reached at laura.crimaldi@globe.com. Follow her on Twitter @lauracrimaldi. Emily Williams can be reached at emily.williams@globe.com. Elise Takahama can be reached at elise.takahama@globe.com. Follow her on Twitter @elisetakahama.