Dallas County District Attorney Susan Hawk holds a news conference on Oct. 1, 2015, when she returned to work after a leave of more than two months. (David Woo/Dallas Morning News via AP)

DALLAS — A Texas judge swiftly ended an attempt to remove Dallas District Attorney Susan Hawk from office on Friday, ending months of debate over whether the county’s first female DA could be tossed out after disappearing from work for two months and checking herself into a psychiatric hospital for depression.

When Judge David Peeples issued his ruling just before noon, Hawk quietly gasped and became teary-eyed as she wrapped each of her four attorneys in tight hugs.

“When he said the petition was dismissed, my heart just stopped,” Hawk said after the hearing. “I felt like my entire life’s work was on the line. I’m overwhelmed with relief that I can get back to work and not have this dark cloud looming over our entire office.”

During the hearing, which lasted about 90 minutes, Hawk’s attorneys argued that she was being unfairly pursued by disgruntled employees who were attacking her because she suffered from a mental illness.

“One of the things that makes mental illness such a tricky thing is that you can’t see it,” argued one of Hawk’s attorneys, Douglas Alexander. “Governor Greg Abbott in a wheelchair, you can see. We’re compassionate about that. You can’t see mental illness.”

Plenty of capable leaders have suffered from depression, Alexander argued, mentioning Abraham Lincoln and Winston Churchill, who called it the “black dog.”

Prosecutor Patrick Wilson, who was tapped to represent the state, cast the defense’s arguments about mental illness as a carefully crafted PR campaign mounted by Hawk and her supporters to distract from her poor performance in office. He urged the judge to allow the case to move forward to a jury trial so voters could be assured – through sworn testimony and medical records – that their elected district attorney was competent to serve.

“It’s largely a mental job,” Wilson argued.

After issuing his ruling, Peeples declined to comment on his reasoning. But during the hearing, he remarked to lawyers that to find the “perfect truth” of what happened in Hawk’s case would come at a cost — in work hours, in emotional toll, in taxpayer dollars. He indicated that the prosecutors would have to meet a high bar before he would greenlight a process in which “the whole end goal is to take from office someone that the voters put there.”

The judge’s ruling cannot be appealed.

After court, after speaking into the nine television cameras that packed the hallway, Hawk slipped inside an elevator with a small group that included her attorneys and close friends. After the doors closed, Hawk’s shoulders dropped and she quietly asked, “Can I cry now?” One of her attorneys broke into a wide smile. “No,” he said. “Here’s what we’re going to do. WHOOOOOO!” He began shouting at the top of his lungs as the elevator coasted down, and Hawk burst into laughter.

Friday’s hearing capped a tumultuous year for Hawk, whose secrets seemed to steadily leak out just weeks after she took office.

First, in early spring, Hawk forced out two top lieutenants, a public sign of an office in private turmoil. Then news broke that Hawk had spent a month in drug rehab during her campaign and had lied to cover it up.

Word spread across the courthouse that Hawk seemed wild-eyed, paranoid and delusional, convinced that political opponents were tapping her phone and following her. According to one former employee quoted in Wilson’s filing to the court, Hawk once ordered her to shut down her computer while they talked, saying, “People can hear us.”

Then, in late July, Hawk disappeared.

Her best friend and political consultant told reporters that Hawk was on “summer break.” When Hawk finally resurfaced, she revealed that she had checked herself into a psychiatric hospital for treatment of severe depression. She confessed she had made plans to kill herself, first by overdosing on a bottle of Trazodone sleeping pills, later by strangling herself with a blow-dryer cord.

After a two-month stay at the Menninger Clinic in Houston, Hawk returned to Dallas with prescription medications and a plan to reclaim her post as DA. She acknowledged that she had been paranoid as her mental health deteriorated but said she stood by the decisions she had made on the job.

She worked to remind voters that she would still be the woman they had elected to office — a highly regarded former prosecutor of the year, a judge who had championed mental health programs while on the bench, a seasoned lawyer who could effectively run the district attorney’s office — if just given a chance to get back to work.

Since her return in October, Hawk has resumed her duties, appearing at a town-hall meeting and helping to prosecute a murder case.

Yet calls for her resignation — and questions about her mental state — persisted.

Along with his petition, Wilson submitted 37 pages of sworn statements from former employees at the DA’s office, several of them high-ranking, who recounted in detail their experiences with Hawk. Hawk’s former second in command, Bill Wirskye, wrote in an affidavit that he saw signs in late February that Hawk might be abusing drugs.

“When Ms. Hawk would enter my office and sit directly in the morning sun coming in through a window, her pupils were not responsive to the light,” he wrote. “Her mood and demeanor was becoming almost exclusively agitated and manic. Her ability to grasp simple issues and concepts was diminishing. Ms. Hawk would fail to remember important recent events and important items of relevant information.”

Wirskye said Hawk began calling employees into her office for bizarre, disjointed conversations in whih she would question their loyalty. Wirskye said he discussed with colleagues the possibility of staging an intervention or contacting the state bar, the governor’s office or the Texas Rangers.

Hawk and Wirskye had been friends for decades, and he had been one of her biggest supporters during her campaign. In March, shortly after Hawk reportedly accused Wirskye of breaking into her home and stealing a compromising photograph of her years before taking a shot of alcohol that had been set on a bartender’s lap during a bachelorette party, she fired him. Hawk later said she did not believe Wirskye had broken into her home.

“I have no desire to injure Ms. Hawk or the Dallas County District Attorney’s Office,” wrote Wirskye, now a prosecutor in a neighboring county.

Hawk’s attorneys filed a response Thursday afternoon, arguing that the state’s case is a “stigmatizing and improper attack based on the notion that individuals suffering from depressive disorder cannot meaningfully contribute in our society.” Her attorneys went on to invoke the high number of lawyers who suffer from depression and addiction, arguing that “if suffering from depression is enough to disqualify a licensed attorney from being a district attorney, then roughly a quarter of the State Bar is disqualified.” They cast the allegations against Hawk as “quibbling criticisms” and “inter-office personality conflicts” and said the calls for her ouster are an attempt by disgruntled employees to overcome the will of the voters.

Hawk’s attorneys noted that the state’s case rested on the testimony of five former employees, who have not worked at the district attorney’s office for months. Her attorneys offered affidavits from 11 current division chiefs who insisted the office is running smoothly and efficiently.

“In this country, we embrace the notion that when one of our fellow citizens gets ill, we support their efforts to get treatment and applaud their recoveries,” Hawk’s attorneys argued. “Just as it would be contemptible to oust an elected official who must absent herself from work to successfully undergo chemotherapy for cancer, it is equally contemptible to try to oust DA Hawk for successfully undergoing treatment for a mental illness.”

The civil procedure pivoted on a state law enacted in 1879 and rarely used since. It allows a private citizen to request a jury trial to determine whether an elected official has become unfit for office. The unusual case left lawyers on both sides confounded.

“Some of the language is archaic — it uses the words ‘mental defect,’” said Alexander, an Austin lawyer on Hawk’s defense team. “That’s not a term we would use today for depression or mental illness.”