Paris Hilton has been handed a one-year suspended sentence and ordered to attend an “intensive” substance abuse program as part of a plea deal stemming from her drug arrest in Las Vegas last month.

The socialite was detained on 27 August when a small bag of white powder fell out of her purse in front of a police officer. She was charged with felony drug possession after the substance was confirmed as cocaine.

Hilton struck a plea deal with prosecutors last week which allowed her to avoid jail and admit to two misdemeanor charges instead of face up to a maximum of four years behind bars for the felony.

She entered guilty pleas to the minor drug possession charge and to obstructing an officer during a court hearing in Nevada on Monday.

As part of the deal for a suspended sentence, Hilton must remain out of trouble for the next 12 months – or face spending time in jail.

Handing down the sentence, the judge warned the hotel heiress, “The purpose here is to change your conduct… The Clark County Detention Center is not the Waldorf Astoria but I assure you, if you violate the terms of your probation you will serve one year in the Clark County Detention Center. Treat this very seriously.”

Hilton has also been ordered to complete 200 hours of community service and pay $2,000 in fines. In addition, she has been placed on probation for one year.