WALTHAM, Mass. (AP) — The actor who played Luke Duke on the 1980s television show ‘‘The Dukes of Hazzard’’ pleaded not guilty on Thursday to grabbing the buttocks of a female member of the cast of a musical he was supposed to appear in.

Tom Wopat was released on $1,000 bail and was told to stay away from the woman after denying indecent assault and battery and drug possession charges. He refused to comment outside court before driving away.

Wopat, who’s from New York, inappropriately touched the woman on July 23, prosecutors alleged.

‘‘During a rehearsal the defendant allegedly walked behind a female cast member, grabbing her buttocks,’’ they said in an emailed statement.


Wopat, 65, was arrested on Wednesday night on a warrant on the indecent assault charge as he was leaving Waltham High School, where he was rehearsing for a performance of ‘‘42nd Street.’’ Police said that during a search of him and his vehicle they found ‘‘two bags of white powder believed to be cocaine.’’

The actor denied touching anyone inappropriately, according to court documents. He said he flirts but did ‘‘nothing that could be considered inappropriate.’’

He told police that he buys cocaine ‘‘in large quantities and uses it over time,’’ the court documents said.

Wopat was supposed to play Julian Marsh in ‘‘42nd Street’’ at the Waltham-based Reagle Music Theatre of Greater Boston starting Thursday. But the theater announced Thursday that a different actor would play the role.

Wopat said in a recent interview that he has played the role about 500 times.

Besides his role on ‘‘The Dukes of Hazzard,’’ an action-comedy that ran from 1979 until 1985, he has acted in other television shows and movies, is a Tony Award-nominated stage actor and is a recording artist.