Nick Stahl was arrested last night after LAPD vice officers working undercover allegedly caught him pleasuring himself inside a sex shop in Hollywood.

Police say the actor was inside the store's private porn-viewing booth committing a lewd act. He was taken into custody and booked on misdemeanor lewd conduct.

Stahl was released a short time later, only to be confronted by TMZ cameras outside the police station.

The Carnivàle star, who went missing a number of times earlier this year before reuniting with his wife in July and entering rehab for substance abuse, claimed the entire thing was just a "misunderstanding."

TMZ also notes that one of the cops who brought Stahl in was also responsible for interrupting Fred Willard's visit to an adult movie theater in mid-July.

[photo via Getty]