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. When asked why she didn't fight the charge, her attorney, David Chesnoff said, 'Ms. Hilton accepts the responsibility.' She faces a year in jail if she violates the probation and is arrested for anything other than a minor traffic violation. Bonaventure told Hilton there are consequences to breaking the law. 'The purpose of this at this point is that you change your conduct,' Bonaventure said. 'I assure you the Clark County Detention Center is not the Waldorf Astoria.' The plea agreement does not require Hilton to be assigned a probation officer, meaning she won't have to report to anyone. She originally faced a felony cocaine possession charge that would not have resulted in jail time. Clark County prosecutor David Schubert called the plea deal, 'a fair resolution.' 'Our main concern is that Ms. Hilton stay out of trouble over the next year,' Schubert told Bonaventure. Chesnoff said Hilton would continue to volunteer with animal rights groups and children's hospitals to meet the requirements of the plea agreement. 'I know Ms. Hilton is contrite and accepts the responsibility for her actions,' Chesnoff said. Chesnoff said Hilton would attend an outpatient substance abuse treatment program. Hilton was arrested Aug. 26 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. 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 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. Hilton served 23 days in jail in 2007 for a probation violation after pleading no contest to alcohol-related reckless driving. 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. Hilton also attracted a pair of colorful fans. Jake Byrd, 28, wore a shirt with an image of Hilton that read 'Stop the Prosecution' and yelled out to her. Byrd said he had traveled from Chino, California, to show support for Hilton. 'I love Paris Hilton because she's classy, sassy and brassy,' Byrd said. 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. 