Kayden Clarke let the world see him at his most vulnerable.

In the video he uploaded to YouTube in 2015, he’s in the middle of an Asperger’s meltdown, sobbing and smacking himself in the face. The only thing that calms him is his service dog Sampson, a 4-year-old Rottweiler that paws at Clarke’s hand, then nuzzles in close as his sobs subside.

More than 2.5 million people viewed the video, getting an unfiltered look at a bad day for someone struggling with a developmental disorder. Positive comments poured in, thanking Clarke for his courage.

But Clarke’s problems continued to plague him. A year after his video went viral, police were sent to his house for a bigger crisis.

It was Feb. 4, 2016, and Clarke, who also suffered from bipolar disorder and depression, wanted to kill himself.

According to a lawsuit, which was filed Friday in Arizona Superior Court by his mother, Clarke was suicidal and had a knife. He had emailed a friend with a final request: Take care of Sampson, the dog seen in the viral video.

The friend called the police.

The lawsuit said the Mesa, Ariz., police department had dealt with Clarke before and knew about his mental and developmental issues. But instead of talking Clarke down, “the situation escalated dramatically and nonsensically.”

One responding officer went outside to retrieve a bean bag gun, a painful but nonlethal weapon. Two other officers approached the darkened room where Clarke was hiding.

Through the doorway, officers glimpsed Clarke holding the knife. They shouted at him, ordering him to give himself up, the lawsuit says.

Clark was “clearly confused and terrified” and screamed at the officers that he “would not be taken back to the psychiatric ward or be medicated,” the lawsuit says.

Officer Stephen Shannon flicked a light switch, and the sudden brightness frightened Officer Joseph DeMarco and Clarke, according to the suit. Clarke, still armed with the knife, started walking toward the officers.

Shannon fired his service weapon, but his bullet went through a wall.

DeMarco fired a single bullet that struck Clarke in the abdomen. He died later that night.

“They cornered [Clarke] in a small darkened room. Instead of trying to calm [him], the officers drew and pointed their guns in the dark and shouted demands, terrifying [Clarke],” the lawsuit said.

The shooting happened “for no good reason whatsoever,” it argues.

The Mesa Police Department didn’t immediately respond to messages seeking comment. In a video uploaded by the Arizona Republic after the shooting, a police spokesman said Clarke appeared to be a threat.

Clarke “lunged, extending the knife towards the officers from a very close distance,” Detective Esteban Flores said. “The officers felt threatened at that point,” and so they shot him.

His legal name at the time was Danielle Jacobs, but Clarke was transitioning from a woman to a man, his friends said. Legal documents and police reports list him as Jacobs.

Clarke’s fatal shooting came as police departments are increasingly under scrutiny for using deadly force instead of de-escalating situations. Many, including the Mesa Police Department, have been criticized after disastrous encounters with the mentally ill.

Last year, 241 of the 963 people who were killed by police were having some kind of mental-health episode, more than 1 out of every 4, according to a Washington Post analysis of police shootings in the United States.

As The Post’s Peter Holley and Wesley Lowery reported, the problem is bigger than simply trigger-happy police officers.

“These shootings are tragedies for everybody involved,” Chuck Wexler, executive director of the Police Executive Research Forum, told The Post. “Too often these calls come in and officers understandably think they need to take action right away. But in a medical emergency, slowing it down, getting additional resources and perhaps even stepping back is the direction that many are advocating.”

“You don’t blame the officers; you blame the training they receive,” Wexler said.

People with untreated mental illness are 16 times as likely to be killed during a police encounter as other civilians approached or stopped by law enforcement, according to a study by the Treatment Advocacy Center.

After Clarke’s shooting in Mesa, the police department changed how it handled cases involving the mentally ill. The department created a crisis-intervention team to handle similar situations and a mental-health board to review policies, officials said.

“My goal will be to have Mesa Police Department above the national standard by the end of this year,” then-chief John Meza said at a news conference.

In the suit, Clarke’s mother is asking for unspecified damages for the wrongful death of her child — and for “emotional pain, distress, hardship, suffering, shock, worry, anxiety, sleeplessness and suffering.”

She and her attorneys did not respond to calls seeking comment.

A previous version of this post incorrectly referred to Asperger’s syndrome as a mental illness. It is a developmental disorder. The post has been corrected and updated.

Read more:

Don’t ‘detonate on patrol’: A Muslim cop sues NYPD, claiming colleagues harassed her for years

One-third of officers killed responding to calls were alone, new study of police deaths finds

After shootings, police fear being ‘a public target’ — even at lunch