As a young law clerk in the Hennepin County Public Defender’s office in the early 1990s, Daniel Homstad worked on a case that became a Minnesota judicial landmark, requiring police to record all custodial interviews of suspects.

The famous ruling, decided in 1994 and known simply as “Scales” (the defendant’s name), has been the state standard ever since. If officers fail to record the interview, including the Miranda warning, the interview can be suppressed at trial.

It was an auspicious beginning for the defense attorney and prosecutor, whose career ended abruptly on May 28 when he died by suicide. He was 51.

Homstad, of Apple Valley, had started his own firm in 2016 and was apparently thriving, according to his wife, Heidi Larson, and his two children, Sean, 20, and Jordan, 18.

A native of Hallock in northwestern Minnesota, Homstad attended Gustavus Adolphus College in St. Peter and what was then Hamline University School of Law, where he met Larson. He began his career right out of school with the Hennepin County Public Defender’s office and remained there for 15 years, before switching to the other side of the courtroom and working as a prosecutor.

Before he died, Homstad estimated he had represented 13,000 clients as a public defender — the job that was his true passion.

“He always wanted people to have a second chance,” Larson said. “He really cared about his clients.”

He was also the guy who kept everyone laughing, his wife said. She and Homstad had planned a trip to Iceland next month to celebrate their 25th wedding anniversary.

Larson said she had no idea that her husband was struggling. But the family quickly decided to be open about how he died. They had two choices, she said: Simply note that “He died unexpectedly at 51,” or remove the stigma of depression and suicide and perhaps spark a conversation for others.

Public defender Mark Devaraj and Homstad met during their freshman year at Gustavus, were roommates during law school and tried their first murder case together as young attorneys. To illustrate the fight between their defendant and the deceased in his closing argument, Homstad dropped to the floor and vigorously rolled around to the point of tearing his best suit. Two outraged prosecutors objected, but it worked and the client was acquitted with the unorthodox “stop, drop and roll” strategy.

Jordan Homstad, who gave a eulogy at the funeral along with Devaraj and fellow defense attorney Bob Paule, described her father as silly, charming, self-deprecating and kind. He loved downhill skiing, Star Wars, cats and Iron Maiden concerts, she said, and had looked forward to earning a master’s degree in military history.

Jordan recalled regular family viewings of the “The Lord of the Rings: The Fellowship of the Ring,” and how her dad always repeated his favorite exchange: “I wish it need not have happened in my time,” Frodo said, with Gandalf saying in reply, “So do I, and so do all who live to see such times. But that is not for them to decide. All we have to decide is what to do with the time that is given us.”

Throughout Homstad’s adult life, alcohol addiction and depression lurked, Jordan Homstad said. He had gone for alcohol treatment last summer. “On Memorial Day, two days before his death, my dad was so excited to tell us that he’d made it to 330 days — almost a year,” Jordan said.

She talked about how she struggles to understand what happened and wonders what she could have done. “We’ll never truly know why everything came to this,” she said.

Services have been held.