Alexander Skarsgard

Alexander Skarsgard surprised fans by dressing in drag for The Diary of a Teenage Girl premiere Monday.

The 38-year-old Swedish actor wore a long, blonde wig and sparkling, gold dress to the event at Castro Theatre in San Francisco. Skarsgard towered over co-star Bel Powley and director Marielle Heller, who sported a glittery, red shift and floral dress, respectively.

"The Diary of a Teenage Girl filmmakers and friends had a criminal amount of fun at the San Francisco premiere last night," the studio captioned photos of Skarsgard on The Diary of a Teenage Girl official Facebook.

Skarsgard didn't offer an explanation for his attire, but some speculate the star was paying homage to co-star Joshua Grannell. Grannell performs in drag under the name Peaches Christ, and plays a transvestite character in the film.

    Posted by The Diary of a Teenage Girl on Tuesday, August 4, 2015

The Diary of a Teenage Girl is based on the Phoebe Gloeckner graphic novel of the same name, and opens in theaters August 7. The story follows a teenage girl (Powley) who begins to journal after losing her virginity to her mom's (Kristen Wiig) boyfriend (Skarsgard).

Skarsgard is known for portraying Sgt. Brad "Iceman" Colbert in Generation Kill and Eric Northman on True Blood. The actor is also scheduled for War on Everyone with Theo James and a live-action Tarzan movie with Margot Robbie.