The former politician promised a federal judge she would pay back the $2 million she'd taken from her husband's charity in order to stay out of jail.

AP / UT San Diego, Peggy Peattie Former San Diego mayor Maureen O'Connor.

As Maureen O’Connor stood in court Thursday somberly admitting over the course of years that she had bet a total of more than $1 billion in casinos due to her compulsive gambling, it was the sad culmination of an addiction that dismantled a vast fortune and left her broke and in failing health.

The former mayor of San Diego — and widow of millionaire Jack-in-the-Box restaurant chain founder Robert Peterson, who died in 1994 — lost a total of $13 million to casinos, and confessed to taking $2.1 million from her husband’s charitable foundation only to blow it on video poker. But it didn’t end there. Court records show O’Connor liquidated her savings, sold a number of properties, auctioned her valuables and took out second and third mortgages on her home in La Jolla, Calif. — all of it to only rack up extensive gambling debts.

(MORE: Why the New Definition of Addiction, as ‘Brain Disease,’ Falls Short)

O’Connor, who served as mayor of California’s second-largest city in the 1980s and ’90s, pleaded not guilty on Thursday to a charge of money laundering, striking a deal that allows her to try to pay the money back to the foundation and get treatment for gambling addiction. “I always intended to pay it back,” she said of the money at a news conference following her hearing. “And I still intend to pay it back. In that period of time I lost my husband, three siblings, best friends.”

O’Connor, 66, suffered a stroke and had a brain tumor removed in 2011; she now lives with her twin sister, Mavourneen, and says she suffers memory loss and sometimes has trouble reading. She blames her gambling compulsion on the tumor. “There are two Maureens — Maureen No. 1 and Maureen No. 2,” O’Connor said at her press conference. “Maureen No. 2 is the Maureen who did not know she had a tumor growing in her brain.”

A wunderkind who was elected to San Diego’s city council just three years after graduating college, O’Connor was once one of California’s most popular politicians. One of 13 children and the daughter of a bookie, she grew up in poverty, worked as a Catholic school teacher and won a seat on the city council in 1971, where she served until 1979.

With the support of political friends like one-time mayor and future governor Pete Wilson, O’Connor rode into the mayor’s office and stayed in that seat from 1986 to 1992. Among her greatest accomplishments was overseeing the construction of the city’s downtown convention center. After leaving office she kept a relatively low profile, penning a few op-eds for the San Diego Union-Tribune. After her husband’s death from leukemia, in 1994, O’Connor remained a trustee of his charity, the R.P. Foundation. Her personal fortune at the time was estimated to be between $40 and $50 million, her attorney said.

(PHOTOS: Hard Times Hit Las Vegas)

But records show that beginning around 2000, she began to splurge in casinos in San Diego, Las Vegas and Atlantic City; before long she was in over her head. According to IRS files, O’Connor had more than $1 billion in winnings from the casinos between 2000 and 2009 — but she also reported losses that were greater than her wins.

In order to keep herself afloat — and continue gambling — O’Connor began to liquidate her assets; when that dried up, leaving her with no money to pay her debts, she dipped into the charitable fund’s finances. Starting in 2008, she arranged a series of transfers from the foundation to her personal account totaling $2,088,000.

The transfers left the charity bankrupt and its accounts were closed that same month. O’Connor listed the transactions as “loans” to hide her theft and avoid paying taxes. While O’Connor did attempt to pay the casinos what she owed them, prosecutors say she also knew that draining her husband’s charity was a misappropriation of funds, as they ran against the foundation’s stipulations that money taken from it be used for charitable purposes.

She was caught and charged with wire fraud for trying to transfer $449,000 from the foundation’s account, then using that money to write a check for $100,000 to the Bellagio Casino in Las Vegas.

The deal O’Connor cut with U.S. District Judge David Bartick defers prosecution as long as she agrees to pay restitution to the foundation; if she fails to do so she faces jail time and fines. Although O’Connor doesn’t currently have the ability to pay the debt back on her own, she is currently seeking damages over a $7.5 million real estate transaction that went south in 2005. Her attorney says she plans to use any money won in that suit repay the foundation.