Sean Hayes has signed onto CBS’ “The Millers” as a series regular for the comedy’s upcoming second season.

Hayes will play Kip Withers, Carol Miller’s (Margo Martindale) new best friend and source of friction for her son, Nathan (Will Arnett).

“After years of being a fan and hearing from others how wonderful he is to work with, I couldn’t be more excited about Sean Hayes joining ‘The Millers,’ ” said Greg Garcia, series creator and executive producer, in a statement. “The thought of he and Margo Martindale as BFF’s makes me smile every time I think about it. We’re only just getting started, and writing this season’s stories has been a blast.”

Hayes most recently starred in and executive produced the sitcom “Sean Saves the World,” which was canceled by NBC in January. His additional credits include “Smash,” “Up All Night” and most famously “Will & Grace,” on which he played Jack McFarland for eight seasons.

“The Millers” returns for season two at 8:30 p.m., Oct. 30 on CBS.