(CN) - An embattled Texas district attorney can keep her job after admitting she drove drunk, a state judge ruled.
State district Judge David Peeples ruled in favor of Travis County District Attorney Rosemary Lehmberg last week after a three-day civil trial.
The Travis County seat is Austin, the state capital.
Lehmberg in April pleaded guilty to criminal drunk-driving criminal charges.
Travis County Attorney David Escamilla then filed a lawsuit asking for her removal.
Lehmberg wiped away tears after the ruling last week as she hugged her legal team and gave the thumbs-up to the gallery.
"Obviously, I am relieved," Lehmberg said outside the courtroom. "This has been a long eight months. First of all, I want to apologize again for my behavior. I think I have said over and over again that is was inexcusable and I have tried to do everything I can to fix it. ... I want to thank everyone who has supported me in my attempt to regain the confidence of this community."
Lehmberg thanked her attorneys and promised the community to "keep doing the right thing, like I always have."
Assistant Travis County Attorney Jim Collins told Judge Peeples that keeping Lehmberg in office would harm the public interest, the Austin American-Statesman reported.
Peeples claims Lehmberg had a pattern of lying and was not managing her problems with alcohol. He said Lehmberg was so drunk during her arrest that she could not walk and did not know where she was.
Peeples claimed that it was not an isolated case of being drunk: that her alcohol receipts showed she spent $8 on vodka a day.
"It is nothing else but by the grace of God that we're here for a removal hearing and not a funeral," Collins said in closing arguments. "She lies even under oath. Mostly she lies about what she drinks."
Lehmberg's attorney Dan Richards claimed the state had not proved that Lehmberg is unfit for office. He said Lehmberg pleaded guilty within a week of her arrest, is seeking treatment and that her duties had not been affected.
"I am a believer in redemption. I am a believer in Ms. Lehmberg," Richards said. "And I am a believer in recovery."
Lehmberg testified in her own defense on the second day of the trial. She said she has struggled with alcohol, chronic back pain and political pressure.
As district attorney, Lehmberg, a Democrat, is the highest felony prosecutor in the county and heads the state's Public Integrity Unit, which conducts ethics investigations of elected officials.
Shortly after her arrest, Republican Gov. Rick Perry demanded her resignation. When Lehmberg refused, Perry followed through on a threat to eliminate funding for the Public Integrity Unit. That brought another lawsuit .
Perry issued line-item veto of Senate Bill 1, stripping the watchdog unit of more than $7 million.
"Despite the otherwise good work the Public Integrity Unit's employees, I cannot in good conscience support continued state funding for an office with statewide jurisdiction at a time when the person charged with ultimate responsibility of that unit has lost the public's confidence," Perry said in a statement at the time. "This unit is in no other way held accountable to state taxpayers, except through the state budgetary process. I therefore object to and disapprove of this appropriation."Follow @davejourno
Read the Top 8
Sign up for the Top 8, a roundup of the day's top stories delivered directly to your inbox Monday through Friday.