LAS VEGAS (AP) -- Paris Hilton acknowledged Monday that she had cocaine in her purse and pleaded guilty to two misdemeanor charges stemming from her arrest last month at a Las Vegas hotel-casino.

She will serve a year of probation and avoid a felony charge under the terms of a plea deal worked out with prosecutors. The celebrity heiress pleaded guilty to drug possession and obstructing an officer.

Hilton, 29, must complete a drug abuse program, pay a $2,000 fine and serve 200 hours of community service.

Hilton — wearing a champagne-colored blouse, a black pencil skirt and black platform heels — told Justice of the Peace Joe M. Bonaventure she was in possession of cocaine.

When he asked what she did to obstruct justice, Hilton, swaying side to side, responded, "I said that the purse wasn't mine to the officer," and acknowledged that she had bought it months earlier.

On Aug. 26 she was pulled aside by police after her boyfriend, Las Vegas nightclub mogul Cy Waits, 34, failed field sobriety tests given by a motorcycle officer.

The couple was stopped in a black Cadillac Escalade after the officer smelled a "vapor trail" of marijuana smoke.

Hilton was arrested inside the Wynn resort, after police say a small plastic bag containing 0.8 of a gram of cocaine spilled out of a Chanel purse she had been carrying as she reached for a tube of lip balm in front of a police lieutenant.

Hilton told police the purse and cocaine were not hers, but claimed some items in the bag belonged to her, including rolling papers, $1,300 in cash and several credit cards.

Hilton was banned from two Wynn resorts on the Las Vegas Strip after the arrest, and her boyfriend was dismissed as a nightclub partner.

Hilton briefly faced a marijuana charge in July after a FIFA World Cup game in South Africa, but the case was dropped when a woman who was with her pleaded guilty to carrying the illegal drug.

At the Las Vegas Justice Court, a crowd of gawkers and photographers followed Hilton as she climbed into a black Cadillac Escalade after the hearing.

Claude Hudson, 74, was removed from the courtroom after he tried to give Hilton a bag of chocolate candy. He said he recently had been released from jail and had written her several letters from behind bars.

During a brief news conference following Hilton's exit, Chensoff said the hotel heiress did not receive special treatment.

"She was treated like anybody else would be treated under the circumstances," he said.