Ed Helms will appear in the second season of Brooklyn Nine-Nine.

The Hangover star will guest star as an agent who works for the United States Postal Inspection Service, according to TV Guide.

He crosses paths with Detective Jake Peralta (Andy Samberg), who struggles to work with him during a case.

Helms makes his debut in the seventh episode of the season, set to air in the US on November 16, "but anybody who enters this world can come back," said co-creator and executive producer Dan Goor.

He added that he and fellow co-creator and producer Mike Schur "know Ed from The Office and The Daily Show, so he'll be great and hopefully he'll have fun and be back."

It was also recently revealed that Desperate Housewives star Eva Longoria would guest star in the upcoming season of the Fox comedy show.