Drop Dead Diva will air its summer finale on Sunday night, and fans will be in for a special treat. 90210 alum Trevor Donovan will guest star on the Aug. 11 episode.

According to The Hollywood Reporter, the hunky actor will play Keith, a "best man" who loses the groom. Under his watch, the groom ends up across the border and then in prison.

But the highlight for some fans will come when Keith must drop his pants in court after making an embarrassing courtroom confession.

Donovan, who is best known for his role as Teddy Montgomery on 90210, was a welcome guest star on the series, according to the show's creator.

"I've been a big fan of Trevor Donovan since 90210," Drop Dead Diva creator/executive producer Josh Berman told THR. "In this Drop Dead Diva with a Hangover-esque twist, I thought he'd be the prefect best man, who, with the best of intentions, gets the groom in a heap of trouble during an out-of-control bachelor party."

Also in the upcoming episode (airing Aug. 11), titled 50 Shades of Greyson, Kim (Kate Levering) represents a housewife who claims that her online erotic novel has been plagiarized by a major publisher. Meanwhile, a mysterious man appears at the firm, yet his motives remain unclear to the lawyers of Harrison & Parker. Owen (Lex Medlin) struggles with his new role as Stacy's (April Bowlby) sperm donor.

Drop Dead Diva airs Sunday night at 9 p.m. on Lifetime. Watch a preview of the season 5 finale: