Nick Ut / Invision/AP 1 / 6
Nick Ut / Invision/AP 1 / 6

LOS ANGELES (AP) -- A man tried to grab or hit Paris Hilton's boyfriend as the couple headed into a Los Angeles courthouse where the socialite was to testify against a man accused of an attempted break-in at her home.

RELATED: Countdown: 13 Blingiest Celebs

The incident Wednesday outside the Superior Court building in Van Nuys was witnessed by an Associated Press photographer and reporters who were interviewing the couple.

The man appeared to get a hand on the neck of Hilton's boyfriend Cy Waits but was immediately seized by a bodyguard and taken away.

RELATED: Trend Report: Bridesmaid Dresses

Hilton has posted on her Twitter account that a "psycho intruder just punched Cy in the back of the head as we were walking into the court house."

Police officer Cleon Joseph says the man has been detained and an investigation is under way.

RELATED: Sexiest Celeb Siblings