A former bookkeeper for a doctor's office has pleaded guilty to stealing more than $2.3 million from her employer, money she poured — as much as $6,000 a day — into buying lottery tickets.

Annie Donnelly, 38, of Farmingville, faces four to 12 years in prison for stealing the money from her employers, Great South Bay Surgical Associates.

Donnelly, who is being held on $150,000 bail, also will have to repay the money. She pleaded guilty Wednesday to second-degree grand larceny.

"She obviously had a gambling problem," said Donna Planty, assistant district attorney. "She appeared to be caught up in the high of winning."

Investigators believe Donnelly may have won jackpots of $5,000 or even $25,000, but never enough to cover the amount stolen overall, Planty said.

Defense attorney George Vlachos declined to speak with reporters. A telephone call to the employer was not immediately returned.

Planty said that between June 2002 and November 2005, Donnelly wrote company checks for cash, petty cash, or checks payable to herself and falsely listed them as payments to vendors associated with the medical office.

She used the money to "feed her pathological addiction," said Suffolk County District Attorney Thomas Spota.

The average check was for less than $3,000, and Donnelly wrote them in oddly numbered amounts to avoid being caught, prosecutors said. She also would "move money around" to different accounts to elude discovery.

In the first year Donnelly stole $41,261. Each year, the thefts increased, with nearly $1.4 million stolen in 2005.