EXCLUSIVE: Will Ferrell has committed to a four-episode arc on NBC’s comedy The Office. He will play a branch manager who comes from the home office and is just as inappropriate as Steve Carell’s Michael Scott character. NBC is still figuring out exactly when the episodes will air, but Ferrell has committed to one episode beyond Carell’s finale, to help create a bridge.

Ferrell called the producers, offering his services because he’s a fan and wanted to commemorate Carell’s swan song by taking part in The Office star’s seventh and final season on the show. Ferrell and Carell are close friends who co-starred in Anchorman: The Legend of Ron Burgundy. The stint brings Ferrell back to NBC, where he launched his career on Saturday Night Live. Additionally, he has done arcs on such series as NBC’s 30 Rock and HBO’s Eastbound & Down, which he also produces.

“We found Steve Carell when he was nothing but a movie star and we turned him into a television star,” said The Office exec producer Paul Lieberstein (who doubles as the annoying Dunder Mifflin HR executive Toby Flenderson, Michael Scott’s arch-nemesis. “We are proud to continue The Office’s tradition of discovering famous talent, and we hope that once America gets a good look at Will, they’ll see what we see, tremendous raw sexuality.”