Kal Penn will play a gay man in an FX comedy pilot.

Belated is written, directed, and executive produced by Peter Tolan (Rescue Me, The Job), Deadline reported.

In the half-hour comedy, Penn plays Owen, a man who realizes he's gay while married to a woman.

In his recently published memoir “You Can't Be Serious,” Penn, 44, announced that he's engaged to Josh, his partner of 11 years.

(Related: Actor Kal Penn comes out gay; reveals he's engaged.)

Belated follows Owen, a doctor living in Connecticut, as he navigates life as a recently out gay man and continues to co-parent with his ex-wife. An additional storyline involves Clay, a 17-year-old transgender teen, who randomly appears on Owen's front stoop.

Penn is best known for his role as Kumar Patel in the Harold & Kumar film series. He also worked in the Obama administration in the White House Office of Public Engagement.