Shadows stretched across the living room, the gray October afternoon giving way to night, as David Hill raised the gun to his head.

Across the room his father sat watching, rigid with dread.

It was just the two of them in the house in Eastham, on Cape Cod: the 23-year-old who said he wanted to die and the father trying to keep him alive. For weeks now, Gerry Hill had been asking for help for his son wherever he could — but real help had never arrived. Police and EMTs. Hospital. Court. Detox facility. It seemed to Gerry that each had done the bare minimum, or less. No one made sure that Dave was cared for. No one took responsibility for what might come next.

The young man pressed the Beretta pistol to his temple. Then he dropped his arm.

“I can’t do it,” he said quietly.

A narrow ray of hope cut through Gerry’s terror. Maybe he could take the gun away and it would end here. Maybe one more chance was all they needed.

Dave stood up and crossed the living room. He bent over his father’s chair and kissed him on the forehead.

“I love you, dad,” he said.

“I love you, too,” said Gerry. “Please don’t do this.”

He watched his son walk out the front door, carrying a gun.

Suzanne Kreiter/Globe Staff Gerry Hill sat on a couch in his home across from the chair where his son, Dave, put a gun to his head.

Outside, twilit pines were sighing in the wind. A half mile down the road, marsh gave way to beach. But Dave turned his car the other way, driving up the winding road that led to the town center.

Gerry didn’t know it, but the young man had a plan. He would die another way; he could make it happen. He was headed for the police station.

A few miles away in the neighboring town of Orleans, Tony Manfredi worked the 4 to midnight shift. He had been on the police force for four years, and he had encountered David Hill before. Three months earlier, on another night when Dave was suicidal, Officer Manfredi had assisted Eastham police, at one point pursuing in his cruiser when Dave fled in his car. Like the other officers involved — like most police statewide — he had no in-depth training in handling mental health crises.

Now Dave Hill was set on suicide again. Tony Manfredi would again be called to Eastham. By midnight, their paths would cross for the last time, in the dark woods at the marsh’s edge.

Nearly half of people killed by Massachusetts police over the last 11 years were suicidal, mentally ill, or showed clear signs of crisis, a Spotlight Team investigation shows. The deaths are the heavy human toll of an ongoing collision between sick people failed by the mental health care system and police who are often poorly equipped to help, but are thrust into this dangerous role.

The Spotlight Team found that 31 of the 65 men and women who were fatally shot between 2005 and 2015 were suicidal or showing clear signs of mental illness, based on interviews, court records, and law enforcement and media reports. Police shot and injured another 24 people who were apparently mentally ill or suicidal in the same period. One third of all police shootings — 55 in all, fatal and nonfatal — involved an apparent mental health crisis.

Julia Cumes for The Boston Globe Wilfredo Justiniano’s sister, Damaris, his brother, Robinson, and mother, Norah, outside the family’s home in New Bedford in 2013. Wilfredo was shot and killed by a state trooper.

The dead include:

■ Denis Reynoso, 30, an Iraq War veteran with post-traumatic stress disorder, whose 5-year-old son was with him in his living room in 2013 when Lynn police shot him after they say he took an officer’s gun.

■ Wilfredo Justiniano, 41, a man suffering from schizophrenia who lived with his mother in New Bedford, who was shot the same year by a state trooper on the side of a Quincy highway at rush hour after he was combative with police, who first tried to subdue him with pepper spray.

■ Bryce Coutinho, 22, who was shot in 2012 in a bedroom by a Marlborough officer after he threatened suicide and approached an officer with a knife.

■ And, in yet another tragic illustration of this enduring problem, a father and son were killed by police in separate shootings, in two different communities, three years apart.

Joseph Ramos, 42, shot in Dartmouth in 2009, and Malcolm Gracia, 15, shot in New Bedford in 2012 were both afflicted by mental health problems. Gracia’s need for help could not have been clearer: Before his death, he had stopped taking his psychiatric medications, sliced his own wrists at least twice, and run away from home. Yet the intervention he desperately needed did not come from the adults in his life — no one reported him as a runaway — or the hospital that treated and released him, but was left to police, whom he had distrusted deeply since his father’s death.

Each death is unique, yet certain scenes replay: The suicidal man who steps toward police with a knife. The distraught young adult pointing a pellet gun that looks real. The troubled son, off his medication, swinging a machete, a screwdriver, a stick. Such provocations are motivated not by violent intent, typically, but rather by self-destructive despair or delusions. At least seven of those killed statewide from 2005 to 2015 yelled “Shoot me!” at officers, according to police reports. So did Robert L. Dussourd, 44, killed earlier this year by police in Braintree — one of at least four apparent suicide-by-cop attempts reported in and around Boston so far this year.

These mental health emergencies have led to police shootings across Massachusetts. Age: Police department: Age: Police department: Previous item 1 of 55 Next item

In 10 cases, police shot people after concerned relatives or friends — and one suicidal man himself — called 911 for help with someone threatening or attempting suicide. In total, police shot 35 people whose statements or behavior indicated they were suicidal.

“I called 911 so they could disarm him, not kill him,” Joan Hart told a reporter in 2007 after her suicidal husband, James, 65, was fatally shot by Quincy police in their backyard after charging officers with a knife.

Barbara Buckley made the same desperate appeal to Brockton police one night last July. “I thought I was doing the right thing,” she said at the time. Police fatally wounded her husband, 45-year-old Douglas M. Buckley, when he brandished two BB guns that resembled real firearms. His wife said she had told police that the guns were not real.

Encounters like these are fraught: Confronting a suicidal person can also endanger police. About 90 percent of the people shot by police had weapons and did not respond when told to drop them, based on a Globe review of police accounts and dozens of reports on fatal shootings by district attorneys. Most often — in 65 percent of shootings involving apparent mental illness — that weapon was a knife or other sharp object, such as a hatchet, machete, or screwdriver. However, 13 percent of the time, police shot people holding firearms.

Seven officers were slashed or stabbed during these violent incidents, including a 2010 case in Somerville in which a mentally ill woman cut three officers with a knife before being fatally shot. Other police were shot at, or threatened by moving vehicles. In some instances — rarely talked about in law enforcement — officers suffered psychological trauma that affected them for months or years.

No one can say how many deaths and injuries might have been prevented if everyone who was shot had received the mental health care they needed. But in many of the cases studied by the Spotlight Team, there were opportunities to head off the showdown with police: cries for help that went unheeded; hospitals that discharged patients too quickly; overwhelming responsibility left to struggling people and their desperate families.

It is a problem that has grown steadily worse for police since the 1970s, as Massachusetts shut down 10 psychiatric hospitals and returned thousands of mentally ill people to their communities ­— often with grossly inadequate outpatient care.

Deinstitutionalization allowed many people with mental illness to lead happier, more productive lives, but it also meant many more mental health crises unfolded in suburban living rooms and on city streets instead of on the grounds of state hospitals. Without adequate community-based mental health care to address them, complex problems escalate until they finally fall to the police.

Police in Boston said calls about EDPs — emotionally disturbed persons — grew from nearly 2,800 in 2008 to nearly 3,400 in 2014. A 1996 survey of 174 large US police departments found that 7 percent of all calls involved mental illness. Experts believe the true number may be 10 percent or higher.

“Clearly, we have a lot of people walking around with mental health issues, and not enough beds and institutions,” Boston Police Commissioner William B. Evans said in an interview. “Years ago, many of them were forced out onto the street, and we’re the ones who are left to deal with it.”

It’s a job that most police are ill prepared to handle.

Despite greatly increased demand for police intervention in mental health crises, fewer than 20 percent of the state’s police forces have sent officers to intensive, 40-hour crisis intervention team training — considered the gold standard for dealing with people in mental health crisis — or hired social workers to ride with police on calls, according to the state office of the National Alliance on Mental Illness, which has taken a lead role in organizing training. In the absence of statewide standards, many cash-strapped police departments settle for minimal in-service training sessions.

Law enforcement experts say that conventional tactics can escalate mental health crises instead of relieving the tension. In the Massachusetts shootings, police often rushed in, yelled at and advanced on people with weapons — strategies deeply ingrained in traditional police training, but shown to make the use of force more likely.

Indeed, many of the fatal shootings happened quickly, with only minutes elapsing from the initial 911 call to the radio callback, “Shots fired!” In only a handful of cases did police call in trained negotiators or attempt to use less lethal weapons such as beanbag rifles or Tasers. In at least one fatal shooting — that of Ronald E. Wood by State Police in 2009 — beanbag rounds were used to disarm the suspect only after troopers fired the fatal shots.

“Police traditionally are going to close the gap and deal with the weapon,” said Geoffrey Alpert, a criminology professor at the University of South Carolina who has studied police use of force. “They should be slowing it down and increasing distance — that’s deescalation.”

In the midst of impassioned national debate about race and policing, prompted by a spate of shootings of unarmed black men, shootings of people with mental health disorders have inspired less outrage. No national law enforcement database tracks police shootings of mentally ill people. Recent efforts by journalists to count them, notably at The Guardian and The Washington Post, found that mental health was a likely factor in at least one-quarter of all fatal police shootings in the U.S. last year.

The percentages calculated by the Globe aren’t exact, in part because the list of officer-involved shootings kept by Massachusetts State Police is incomplete. The agency said it only began formally maintaining the statewide list a few years ago, and it appears to be missing some incidents. Globe reporters identified 10 shootings involving mentally ill people that did not appear on lists provided by the state.

In addition, there are likely some additional cases where mental health was a factor, but the illness was undiagnosed or went unmentioned in public reports.

“I think the public is unaware of how huge a problem this is for police,” said Chuck Wexler, executive director of the Police Executive Research Forum, a policy group in Washington, D.C., and a former police official in Boston. “And you have to ask: Why is it a police issue, when it’s better handled by a social worker? Police shouldn’t own this problem alone.”

On a soft summer night on Cape Cod, Dave Hill was asking for someone to help him. He had broken up with a girlfriend. He was drinking too much. “I just want to die,” he told his father. “I need help.”

It was July 2006, three months before his final encounter with Officer Manfredi. Dave was in a downward spiral. His father felt afraid, but far from hopeless: There had to be a way to get help for his son.

Dave’s plea that summer evening startled his dad into action; it was rare for the young man to admit suffering. Quickly, Gerry Hill dialed 911. Two police cruisers and an ambulance raced to the house. It was not an uncommon call in Eastham, with its year-round population of 5,500, or on Cape Cod, where mental health crises are as common as anywhere else. The EMTs asked Dave if he would go with them to Cape Cod Hospital in Hyannis. Again surprising his father, Dave said yes.

Gerry remembers standing in his yard, listening as an EMT reassured his son. “It will be OK,” the medic said. “There will be someone you can talk to when you get there.”

There wasn’t, says Gerry Hill. Dave had to wait; no mental health clinician was available. His father says that Dave reacted badly, demanding to leave the ER. Hospital security stepped in and Dave was removed to a padded room.

When he went to see his son at the hospital that night, Gerry said, a doctor promised him that Dave would meet with a psychiatrist the next day.

Instead, said Gerry, his son was released the next morning after a brief interview with a social worker who asked him if he planned to harm himself. Dave said no. And with that, his hospital visit was over. There was no referral to outpatient care, according to Gerry, no help finding Dave a therapist.

After his son called him for a ride home, Gerry called the hospital, distraught. “You have made a tragic mistake,” he told the social worker. As he remembers it, he made the woman so nervous she went outside to search for Dave in the parking lot.

But Dave was already gone.

The relief Gerry had felt as the ambulance left with Dave in it floated up into the summer sky and disappeared. The 64-year-old hung up the phone, his terror keener.

Suzanne Kreiter/Globe Staff A photo of Dave Hill on a wall in his father’s restaurant.

Hospitals are required by law to walk a careful line with patients in mental health crisis. If someone is found to present “a likelihood of serious harm by reason of mental illness” — either to himself or other people — the hospital may keep him. But once he no longer poses that danger, a patient who wants to leave must be released. Because no lab test can divine a patient’s thoughts, clinicians largely rely on patients’ statements. Recent history and behavior are considered, but in many busy ERs, there’s little time to interview family and police and review records.

Officials at Cape Cod Hospital declined to talk to the Globe about what happened in the ER that night. A spokeswoman first cited patient privacy; later, after Gerry Hill offered to sign a release, she said it would be too difficult to comment on a case from 2006.

Hospital records requested by Gerry Hill say that Dave was agitated and verbally abusive during his ER stay, and that he was placed in seclusion. Elsewhere in his record, a staff member wrote that Dave would be “evaluated by Social Services a little later in the day [after] sobering up.” If that evaluation took place, there is no indication in the paperwork that it included a referral to outpatient psychiatric care.

The form that authorized Dave’s move into seclusion specified the reasons: He was violent, an escape risk, with “substantial risk of self destructive behavior.” He was checked on by a staff member every five minutes all night. Yet sometime the next morning, after telling a clinician he would not hurt himself, he walked out the door. A staffer penciled in his discharge diagnosis: suicidal ideation.

To police and families on Cape Cod and across the state, it can be bewildering to see patients in crisis discharged so quickly. “You’re still writing your report, and the person you sent [to the hospital] is already home,” said one Cape officer, a view that was echoed by police elsewhere.

Emergency room visits by suicidal people are a “major potential opportunity for intervention that could save lives, and there’s been no standardized way to handle them,” said Dr. Christine Moutier, chief medical officer for the American Foundation for Suicide Prevention.

When Dave Hill threatened suicide again, just one week later in July 2006, his interaction with police swiftly escalated. Intoxicated and belligerent, he made threatening statements on the phone, suggesting that he had a gun and might shoot officers.

Eastham Police Sergeant Robert Schnitzer reached Dave on his cellphone and tried to persuade him to return to the hospital. Dave refused, claiming he had been roughed up and hurt by security guards during his last visit.

“David’s behavior [was] dangerous and unpredictable,” the sergeant later wrote in his report. “The situation had the potential to turn deadly.” Police feared “a suicide by cop situation.”

Eastham called for a SWAT team and backup from other towns. Among those who responded was Tony Manfredi from Orleans. He was sent to manage traffic near the Hill house. When Dave left home in his black Pontiac Firebird, Manfredi accelerated his cruiser in pursuit.

On that night, though, no one was seriously hurt. Dave returned home, where SWAT officers surrounded him and talked to him. Dave resisted, allegedly hitting one of them, and was taken into custody. At the police station, he was charged with assault. Then an ambulance took him back to Cape Cod Hospital, one week after his overnight stay.

In the ER, Dave was angry, cursing, agitated. Handcuffed to the bed rails, he tried his best to break them, yanking against the handcuffs violently, a report stated. Police repeatedly called security guards to help control him. An officer snapped on a second set of handcuffs.

Several hours later, social workers delivered their verdict: “David was not going to be admitted because he was not meeting the psychological criteria for inpatient committal,” Eastham police wrote in their report. Just as it had a week earlier, the hospital found Dave was not a danger, so it could not keep him. He would go to court instead to face the charge against him.

On the hospital records kept by his father, Dave’s discharge diagnosis was listed as depression. His discharge instructions — a total of four words — were scrawled almost illegibly: “To court with police.”

Dave Hill left the ER in a police car, bound for the courthouse in Orleans, seven hours after he’d arrived by ambulance. His second chance to find help at the hospital had passed. This time, he would not be coming back.

On a warm and sunny Monday last September — the first day of a 40-hour crisis intervention course in Springfield — two dozen police officers from around the state sat at tables in a basement classroom. Most were men dressed casually in polo shirts and khakis, with their service weapons holstered on their belts. A presenter from the state Department of Mental Health was asking a tough question: “Why are some people hospitalized and some not?”

After a hearty lunch of pasta with red sauce, instructors passed out earbuds and mp3 players and introduced the next lesson: Officers would be asked to complete routine tasks — writing down numbers; answering questions — while listening to a soundtrack of yelling and whispering voices, similar to the auditory hallucinations experienced by some people with schizophrenia.

“What’s wrong with you?” the voices growled. “Shut up. Don’t touch that. You’re stupid.”

Dina Rudick/Globe Staff Police officers listened during crisis intervention team training, a 40-hour program that is considered the gold standard of police preparation for encounters with people in crisis.

The goal was greater insight — and maybe empathy — about the challenges of life with mental illness. Afterward, though, most officers seemed unbothered. “I’m married with four kids,” one joked. “There’s always something going on.” Others said their jobs had taught them to ignore distraction.

“Imagine if it never stopped,” a trainer prompted.

The room was quiet. “I would snap,” said one.

Training sessions like the one in Springfield stress the value of listening and waiting, showing empathy and asking questions — in contrast to traditional police training, which critics say overemphasizes rapid problem-solving. That approach can sharply raise the stakes in encounters with troubled, unpredictable people, some of whom are angling for police to shoot them.

Definitive statistics on “suicide by cop” are nonexistent, but some data suggest such incidents are happening more frequently. Fatal police shootings resulting from attacks on officers increased 67 percent, from a yearly average of 153 to 255, between 1980 and 2008, according to a national study by the National Sheriffs’ Association and the Treatment Advocacy Center.

In Massachusetts, where the suicide rate has long been lower than in most other states, the total number of suicides per year grew an alarming 47 percent from 2003 to 2012, from 424 to 624. Most occurred in a mental heath care vacuum: Two-thirds of Massachusetts residents who killed themselves in 2012 weren’t receiving any treatment, according to the Department of Public Health, though multiple studies have found that 88 to 90 percent of people who commit suicide have a diagnosable and potentially treatable mental condition.

Dina Rudick/Globe Staff Lynsey Heffernan, coordinator for the state Department of Youth Services juvenile detention alternative program, spoke to several dozen Massachusetts police officers during a recent crisis intervention team training session in Somerville.

Even as they are increasingly engaged with people in crisis, most police receive little preparation for those encounters, though Massachusetts did revamp its police academy curriculum in 2013, expanding from three hours to 15 the time police recruits spend learning to recognize psychiatric distress and practicing deescalation. In addition, since 2014, all veteran officers have received three hours of deescalation training that stresses the value of dialogue and patience.

More effective in improving outcomes, experts say, are ongoing “diversion” programs in which police change their fundamental approach by teaming up with mental health care providers. Framingham launched the first such program in the state in 2003, when then-chief Craig Davis hired a social worker to ride with officers. More than a dozen departments statewide have since followed suit. Dozens more have trained officers in the crisis intervention team approach.

Still, most communities have no program, and many that do exist are limited in scope: a handful of well-trained officers in a department instead of the 25 percent recommended; a partnering clinician who covers a small fraction of all shifts. A legislative proposal to address the issue by creating a new statewide police training center is not expected to make it to a vote this session.

About 20 percent of police departments in Massachusetts provide significant crisis training to officers or send social workers to mental health related calls: Adams

Amherst

Arlington

Ashland

Attleboro

Barnstable

Belmont

Boston

Boxborough

Bridgewater

Brockton

Brookline

Cambridge

Chatham

Chicopee

Dalton

Danvers

Duxbury

Easton

Egremont

Everett

Fall River

Fitchburg

Framingham

Greenfield

Holliston

Holyoke

Hopkinton

Lanesborough

Lawrence

Lee

Lenox

Lynn

Malden

Marlborough

Medford

Monterey

Nantucket

New Marlborough

New Bedford

Newton

North Adams

Northampton

North Attleborough

Norton

Pittsfield

Quincy

Raynham

Rehoboth

Salem

Seekonk

Sheffield

Sherborn

Somerville

South Hadley

Springfield

Stockbridge

Stow

Taunton

Wakefield

Walpole

Waltham

Watertown

Westfield

Weymouth

Winchester

Worcester

Yarmouth

A Globe survey of police departments involved in shootings where mental health was a factor found wide variation in their preparedness and in the effective use of training.

“Just because you have training doesn’t mean it has an impact,” said Alpert, of the University of South Carolina. “To have an impact, you have to be making changes — identifying mental illness; using less force. Unless there’s evidence that’s happening, training is just words.”

Even police chiefs who acknowledge its importance stress that training can’t change every outcome. On the night in March 2014 when a suicidal man was shot in Hingham, no amount of training could have prevented it, Police Chief Glenn Olsson said.

Brian Middendorf was depressed, drinking, and determined to die that night when he called police and said he had a weapon. When the 33-year-old stepped out of his vehicle after a chase and raised a realistic-looking pellet gun, officers screamed at him to drop it. They fired at him five times when he didn’t, hitting him in his thigh and arm.

Struck in an artery, he was bleeding out when an officer took off his belt, made a tourniquet, and saved him.

“They saved my life two different ways,” says Middendorf, now 35. “That night, and in the long run, because I have a good life now.”

Gary He for The Boston Globe Brian Middendorf and his girlfriend, Jackie, posted pictures to social media before participating in the Out of the Darkness overnight walk for suicide prevention in New York City on June 4.

Sober and in counseling since the shooting, Middendorf says he gave police no choice.

“I forced it, and I’m not a victim,” said the Hingham native, who served time in jail on charges from that night and still suffers chronic pain from his injuries.

Officers in Hingham still have not attended weeklong crisis intervention classes. The chief said both funding and logistics are obstacles for small departments like his: The training is free, but replacements must be found, and paid, to cover shifts for those who attend, a cost of about $2,000 per officer trained.

Funding is one problem. Societal indifference is another, said Ben Linsky, a mental health counselor who responds to calls with police in Boston.

“As a society, we don’t value these things, so we don’t give them attention or money,” he said.

Recent events underscore his point: Boston police, who for the last two years had two ride-along counselors, recently lost the federal grant that covered the salary for the second one. The department dropped back to one clinician last month, reducing its mental health coverage from five of 11 police districts to three.

Officers’ instincts often must stand in for training. Bruce McMahon had received no special training in 1999 when he found himself locked in a standoff with a man who had just been released from Bridgewater State Hospital. Yet the officer’s approach was textbook deescalation: slowing down, speaking softly, showing empathy. The man had a butcher knife and threatened to cut McMahon’s head off; he also threatened to kill himself. For 45 minutes, McMahon talked to him, from seven feet away, in a tiny, windowless basement room. He asked if he could call the man by his first name, Walter. He told the man to call him Bruce.

“We talked and talked and talked,” recalled McMahon, now the Easthampton police chief. “I knew I was going to talk for as long as I could. I told him I wanted to help him, that he wasn’t a bad person.”

Eventually, when Walter sat down to drink some vodka, McMahon and other officers tackled him and took him into custody.

Seventeen years later, McMahon says he remembers every detail of his hour in that basement. He knows how easily it could have turned out differently.

“When they don’t know who to call, they call police,” he said. “It’s a huge burden. And some of it is luck.”

As Dave Hill lay handcuffed to his hospital bed, after threatening suicide twice in July 2006, his parents came together to try to save their son.

They were divorced — Dave’s mother lived in Maine — but they talked that summer, joined by fear, said Gerry. Martha Hill did not respond to interview requests. It was his ex-wife who suggested they go to court to try and have Dave committed, said Gerry. But she feared that if they did, Dave would hate her for it.

“I’ll do it,” Gerry offered. “He can hate me.”

He and his son had always been close. They spent hours together in the breezy driveway, rebuilding classic cars, and Dave helped out at his father’s Route 6 sandwich shop. He was generous and loving, but his father worried. Diagnosed with attention deficit disorder at 12, Dave was later prescribed an antidepressant, but he resisted taking it, his father said. After a traumatizing beating by a bully, said his dad, he had angry outbursts, sometimes breaking things.

For a while after high school, things fell into place. Dave started a business fixing computers; that led to a job with a software company. Then he drank too much one night and insulted his boss, said his father. He lost his job and girlfriend and moved back in with his dad.

Setbacks were deeply painful for him, said one friend.

“He tried to make things perfect, and if it didn’t work he was very unhappy,” said Ksenia Rudyuk, who worked at Gerry’s restaurant and heard Dave speak of suicide more than once. “It was black and white for him — nothing in the middle.”

Gerry had endured his own long struggle with depression, until he found the right medication. That prescription was transformative, he says. It gave him hope. If his own life could be saved, then why not his son’s?

Suzanne Kreiter/Globe Staff Gerry Hill sat in his Eastham restaurant, where part of a wall is dedicated to his son. Hill wears an eye patch after a recent injury.

At the Orleans courthouse, Gerry followed a court clinician’s instructions and asked the judge to commit Dave under Section 35 of state law, which allows the court to order substance abuse treatment. No one mentioned mental health commitment, said Gerry; his son’s suicidal feelings were not a focus. The judge ordered Dave to 30 days of detox at the Massachusetts Alcohol and Substance Abuse Center, on the grounds of the Department of Correction complex in Bridgewater.

“Get me out of here,” Dave mouthed silently, gazing at his father from across the courtroom.

It seemed a limited response, given his mental health history, but in fact, having Dave sent to detox may have been the option with the best chance of success, according to attorneys familiar with the practice. His father could have sought his commitment to psychiatric treatment instead, under the law’s Section 12, but judges tend to be less likely to grant those requests by relatives. Even if a mental health commitment was approved, Dave most likely would have been sent back to the same ER that had just discharged him.

At the treatment center, Dave was forced to stay sober. Back home by mid-August, he seemed better. He sent out resumes touting his computer skills and was thrilled when a Boston firm showed interest. Still, his father felt a lingering unease. Dave was ashamed of his time at the Bridgewater detox, which treats inmates as well as people committed by courts. And his friends had distanced themselves, according to Gerry.

When he asked his son about the detox program, Dave said he had not received psychiatric counseling. A spokesman for the Department of Correction said the center currently has four mental health professionals on staff, serving 150 to 200 participants, each of whom is screened for mental health issues. In 2006, however, there were only two staff counselors.

Maybe the staffing was inadequate. Maybe Dave’s stay was too brief; maybe he hid his past suicidal feelings. Whatever the cause, Gerry was crushed, again, by the system’s seeming failure to seek answers: why Dave drank too much; why he had wanted to die. If there was a discharge plan, Gerry never saw it.

By September, the job prospect in Boston had dissolved. Dave was sure the firm had found out he’d been to detox. Convinced he’d never get a job, he started drinking again. Gerry, desperate, pleaded with him to get help. Finally, in late September, Dave gave in — he would go to see his father’s primary care doctor.

Two days before the appointment, without telling his dad, the young man bought a handgun from a store in Maine.

Officials who review police shootings rarely find reason to doubt that the use of force was necessary. Indeed, state law enforcement officials found the use of force was justified in every fatal police shooting examined by the Globe where the investigation has been completed. In at least five cases, relatives frustrated by the lack of official sanctions filed their own lawsuits against police departments, alleging that officers used excessive force. In some cases, settlements were reached.

Damaris Justiniano filed a federal lawsuit against State Police last year, contending that the agency failed to provide humane, less lethal methods for handling people in crisis. Her brother Wilfredo, 41, who had schizophrenia, was shot and killed by the side of Route 28 in Quincy in 2013 by a state trooper who said Justiniano charged at him with a pen. State police declined to comment, citing the ongoing litigation. The Norfolk district attorney’s office found the shooting justified.

Damaris Justiniano had spent years caring for her older brother: coaxing him to take his medications; searching for day programs that would watch him when she couldn’t. Among the people who helped her most, she said, were the New Bedford police who knew Wilfredo well, who could coax him into going to the hospital.

She still cries when she imagines how confused and scared her brother must have been on the last morning of his life, standing at the edge of the streaming rush-hour traffic as his grip on reality faltered and wavered.

“They took his life away because they didn’t know how else to handle it,” she said.

Police officers stress the need to make split-second decisions when they feel their own lives are in danger. Officers involved in shootings seldom publicly recount their experiences, but occasionally investigative reports allow a glimpse into their thoughts at critical moments.

When police officer Chris Alberini climbed into a hot, dark attic in Ashland on July 2, 2013, with his police dog, Dax, he was expecting to make a routine arrest. Instead, he found Andrew Stigliano, a 27-year-old with a history of drug addiction, holding a shotgun in one hand. Stigliano had just texted his attorney saying he would not be taken by police alive.

“All I could think of was the gun and I’ve got two little kids, and . . . I’m gonna get shot in this attic,” Alberini, an Iraq War veteran, told state investigators later. “I’m an avid hunter. I know what a shotgun can do. There’s no — you know, you’re not gonna get wounded by that. You’re gonna be dead.”

As his dog bit Stigliano’s leg, the officer yelled at him to drop the shotgun and tried to push him to the floor. When the man failed to release his weapon, Alberini said, he pressed his gun to Stigliano’s ribs and fired, killing him.

Every case is different, with one constant: Police shootings leave lasting swaths of trauma, for families, communities, and officers involved.

“Police officers are people; they have the same emotions, and they don’t walk away untouched,” said Major Sam Cochran, a former Memphis police leader who developed the country’s best-known crisis team training for police, CIT, after officers in Memphis killed a suicidal man. “Their experience, if it’s not addressed, can have devastating effects, from alcohol or drug abuse to divorce and suicide.”

Different officers react differently to stressful events — sometimes with strikingly divergent levels of force. When a mentally ill man named Santos Laboy used a three-foot sword to smash cars in Boston one night seven years ago, Boston police retreated instead of confronting him. They contained the man for 15 to 30 minutes while a beanbag gun was delivered to the scene, then used beanbags to subdue him.

Whatever mental health care followed for the man, the effects didn’t last. When Laboy, 44, encountered a State Police trooper in Boston last June and failed to drop his knife as ordered, the trooper shot and killed him. The Suffolk district attorney’s review of the shooting has not yet been completed.

Harrison Hill for The Boston Globe Investigators on a Boston footbridge where Santos Laboy was shot by a State Police trooper on June 19, 2015.

Of 20 shootings where district attorneys’ reports or detailed police records were available for review, at least half occurred within minutes of police arriving on the scene.

David Kingsbury’s 15-year struggle with mental illness ended on a balmy night in June 2014, when 911 calls from neighbors who saw him outside with a knife brought two Springfield police officers to his door. The episode took only four minutes to unfold: The officers rushed to the scene, kicked in the apartment door, and fired four shots at the 34-year-old, striking him in the chest. They said Kingsbury had moved toward them with a kitchen knife, backing them up against a door and ignoring their orders to drop it.

A former high school football player who once dreamed of being a lawyer, the young man known as D.J. was stricken with bipolar disorder in college. Every day, his grieving parents ask themselves: Why did the police break through that door, escalating the conflict and forcing a confrontation?

“Police officers have a right to go home at night,” said David Kingsbury Sr. “They deserve, and we deserve, for them to be trained to handle these things safely.”

Springfield police purchased Tasers, nonlethal electronic weapons, six months after Kingsbury was killed.

In Eastham, on Cape Cod, summer’s last shimmer had passed. Twilight fell on a rainy Tuesday in October as Dave Hill lifted his gun to his head, then lowered his arm, kissed his father goodbye, and left the house.

Outside the Eastham police station, just after 7 p.m., he raised his gun and fired a shot at the small brick building. He raced back home and told his father what he’d done. “Now they’re coming,” he promised.

But no one at the station realized what had happened. An hour later, Dave went back and fired again. This time, around 8:20 p.m., police heard the shots and reacted — but Dave had fled, and no one knew he was the one who did it.

Back at home around 9:30 p.m., Dave seemed ready to accept his plan had failed. Suicidal impulses often pass within one to three hours, say experts; it was possible that Dave’s had come and gone.

At the police station, though, a call had just come in, from a Mansfield police officer who was Dave Hill’s uncle. Dave had called his mom in Maine to tell her what he’d done. She had called her brother, who now told police in Eastham who had fired shots at their station. Then Dave’s mother called the police, too. Dave was on a mission to be killed, she told them.

“He needs help,” she told the sergeant on the phone.

“I know he does,” the sergeant said, according to a transcript. He said police would reach out to Dave by phone “to establish dialogue . . . so that what you are talking about doesn’t happen.”

“[W]e don’t want to shoot him,” the sergeant told Dave’s mother. “So what would be the best way to call him?”

It was now after 10 p.m. Three hours had passed since Dave had first fired on the station. Eastham had requested backup from other towns, a negotiator, and SWAT teams. They surrounded the house and shut down traffic. By taking their time and not rushing in, they were in one sense following the best advice of experts. Yet no one made the phone call they had promised, to establish dialogue with Dave Hill himself. Instead police relied on secondhand reports, the tension heightened by their lack of direct contact.

Dave Hill left his house for the last time after 10 p.m., carrying his gun and cellphone and wearing a bulletproof vest. He walked toward the marsh in the moonless dark.

At 11:13 p.m., Dave’s mother called police back. In tears, she said that she had spoken to her son again; he was in the woods and told her he could see police. According to a transcript of her call, she said Dave had threatened to “take” one of the officers.

“Hey hey hey, heads up,” a voice on the radio warned. “He’s going to take one of us out.”

Standing under a street light at the edge of the woods, at an intersection west of the Hills’ house, Orleans police officer Tony Manfredi feared it might be him who Dave was looking at, according to his later statements to investigators. Manfredi ducked for cover in the woods, seeking safety in the deeper shadows.

Suzanne Kreiter/Globe Staff “When the EMTs arrived, Dave was laying like this.” Gerry Hill said, offering to show where his suicidal son was fatally shot after a tense encounter with police.

A few minutes later, at 11:30 p.m., Manfredi and the officer patrolling with him reported hearing movement in the woods. No other police came to back them up. The sound of dry leaves rustling came again, and Manfredi swept his flashlight beam across the brush.

He saw Dave Hill in the woods, lying on his stomach.

The confrontation Dave had sought had come at last, after hours of mounting tension and no dialogue. Manfredi said he barked a series of commands: Police! Don’t move; show me your hands! Drop the gun!

Dave started to rise, gun in his hand, Manfredi said later. The officer fired his rifle several times. Dave fell into a seated position, the officer said; then Dave’s hand appeared to rise again. Manfredi moved toward him and kept firing. The fatal shot — one of nine in all — hit Dave in the back of his head and fractured his skull.

He lay bleeding on a bed of pine needles and leaves. It was 11:43 p.m.

His father was at the police station when he got the call to tell him Dave was gone. A state trooper, trying to be helpful, offered to bring in a grief counselor.

I can get a counselor now, at 1 a.m., thought Gerry. Yet nobody could ever find a counselor for my son?

A suffocating anger seized him. He could barely speak.

No, he told the officer. I don’t want anyone.

On another overcast October day a year later, Tony Manfredi was at the State House to receive the George L. Hanna Memorial Award, the state’s highest honor for police bravery.

Manfredi, then 29, did not smile as Governor Deval Patrick placed the medal around his neck, according to Richard Hedlund, the former police chief in Eastham, who was present at the 2007 ceremony and later described it to the Cape Cod Times. Hedlund, who has since retired, and Manfredi, now a sheriff’s investigator in Barnstable County, both declined to be interviewed for this story.

George RIzer/Globe Staff Orleans police officer Tony Manfredi received the George L. Hanna Jr. Memorial Award from Lieutenant Governor Tim Murray and Governor Deval Patrick at the State House in 2007.

Manfredi had been visibly shaken after shooting Dave Hill, according to investigators’ interviews. When a sergeant at the scene asked him if he was OK, Manfredi — still holding his rifle — acknowledged he wasn’t. “No,” he said. “[Hill] pointed the gun at me.”

Manfredi told investigators he had followed his training when he spotted Dave Hill in the woods and saw his hand move. He said he had been taught to “engage the target, move toward the threat, and shoot at the threat until it is stopped.” The district attorney found his actions justified.

The stress of that rainy autumn night would linger with him. Four years later, in September 2010, Manfredi was sent back to the same wooded Eastham intersection where he shot Dave Hill, to help manage traffic after a car crash. Memories flooded back. Manfredi reached out the same day to a counselor who had treated him for post-traumatic stress after the shooting, according to a later report by Orleans police.

One week after his return to the scene of the shooting, Manfredi drank too much on a night off and crashed his pickup truck into a tree in Mashpee. His blood alcohol level was three times the legal limit. The officer and his passenger both suffered serious injuries. Manfredi, who admitted driving drunk, was suspended from his job for three months and was sent to mandatory substance abuse classes.

Dave Hill lost his life on the night of the shooting. Tony Manfredi may have lost something as well.

“David was calling the shots; it was in his hands,” Hedlund, the former Eastham chief, told the Cape Cod Times in 2008. “But Officer Manfredi will carry it for life.”

Gerry Hill wore black for two years after his son’s death. In that and every other way he could, he fought to see that Dave — and his death — were not forgotten.

On the back wall of his Route 6 sandwich shop, the Box Lunch, Gerry taped newspaper stories about the shooting, pictures of Dave, even a copy of the autopsy report. Police and other town employees stopped eating there, he said.

He spent months fighting with his neighbors and the town in his efforts to maintain a memorial. He and his family repeatedly nailed silk flowers to a tree near the scene of the shooting; again and again, someone took the flowers down.

“This incident brought violence, danger, gunfire and death to our very quiet neighborhood,” one resident wrote in an e-mail asking the town manager to remove the flowers. “The Hills should not be allowed to force the residents, who were innocent victims, to relive it over and over again through this ‘memorial’.”

Six months after the shooting, in the spring of 2007, the FDA issued a new medication warning. Previously, the agency had warned that antidepressants — including Lexapro, the medication Dave Hill took for three weeks before his death — could increase suicidal thoughts and actions in some children and teenagers. Now it said that young adults like Dave were also at risk.

A decade after David Hill’s death, Eastham police officers still have not attended crisis intervention team training. But much else has changed. The opioid crisis has helped improve communication between agencies. Court record systems now flag mental health and addiction histories, so judges and prosecutors can be mindful of them. Some Cape police ask DMH crisis workers to join them on calls where mental health is a factor. Capewide mental health training for police — the first of its kind — is scheduled to begin this fall.

Eastham’s police chief, Edward Kulhawik, was hired three years after the shooting. Gerry Hill came to see him soon after he arrived.

“He wanted me to know about what happened,” says Kulhawik, “to see what light it could shed on future situations.”

When families come to the chief, desperate for mental health care, he picks up the phone and tries to find something for them.

“Everyone matters,” he tells his officers.