Funnyman Jim Gaffigan has signed on to guest star in the second season finale of Royal Pains, according to TVGuide.com.

Gaffigan will play Pete Stambleck, a no-nonsense park ranger with a personality transplant and a slight case of amnesia. Hank (Mark Feuerstein) has to figure out what happened to him.

Gaffigan, who starred on the recently canceled My Boys, can also be seen in the romantic comedy Going the Distance, starring Drew Barrymore and Justin Long.

Royal Pains has been a ratings darling since its premiere in 2009. The show gave USA its highest series premiere ratings (5.57 million watched the premiere) since Psych in 2006, and the viewership increased over the second and third episode by almost a million viewers.

Royal Pains aired its summer finale in August and will return to USA this winter with six new episodes that wrap its second season. An airdate has not yet been announced for Gaffigan's episode.