A US judge has given Paris Hilton a one-year suspended sentence after she pleaded guilty to drug possession and obstructing a police officer.

Demurely dressed in a champagne blouse and black skirt, the sombre 29-year-old appeared in court on Monday morning (pictured) to admit possession of cocaine after agreeing to a plea deal with prosecutors.

Paris – who avoided jail time as part of the agreement – also received a $2,000 (£1,280) fine and 200 hours of community service.

She could have faced up to four years in prison on the drug charge.

Last month, the socialite was arrested in Las Vegas after the car she was travelling in was pulled over and 0.8 grams of cocaine was found in her purse.

At the time Paris told police officers that the bag and drugs were not hers.

If the heiress is arrested in Las Vegas again within the next year, she will face a year in jail.

Justice of the Peace Joe Bonaventure told Paris the purpose of her sentence was "that you change your conduct".

"I assure you the Clark County Detention Center is not the Waldorf Astoria," he said, referring to the Manhattan hotel where Paris spent much of her childhood.

After the hearing, her lawyer David Chesnoff (pictured) told reporters: "She was treated like anyone else would be treated under the circumstances, and I'm very proud of the way she's dealt with this.

"I think she's on the road to success and I wish her personally the best."