If there's one guy who can play a worse boss than Steve Carell, it's Will Ferrell -- and the movie star is set to do just that.

Ferrell, a long-time friend and co-star of Carell -- the two featured together in 'Anchorman: The Legend of Ron Burgundy' -- will join the workplace comedy for a four episode arc near the end of this season, Deadline.com reports.

Carell's Emmy-winning time on 'The Office' is winding down, and the show has been waiting to reveal his replacement at Dunder Mifflin. Ferrell will play a branch manager that comes in as Carell's Michael Scott begins leaving, and will take over for at least one episode.

"We are proud to continue The Office's tradition of discovering famous talent," 'The Office' show runner Paul Lieberstein (who plays Toby on the show) said, "and we hope that once America gets a good look at Will, they'll see what we see, tremendous raw sexuality."

Ferrell and Carell's careers often intertwine: Carell tried out for 'Saturday Night Live,' claiming he lost out to Ferrell, and they starred together in 2005's 'Bewitched.'

UPDATE: **SPOILER ALERT** Ferrell's addition was announced on television in a promo for the show's next episode, airing April 14th. Carell's Michael Scott laid the groundwork for his exit, proposing to girlfriend/co-worker Holly and announcing that they were moving to Colorado. Carell's last episode will air on April 28th.

Rainn Wilson gave an inside look at how Ferrell's arc came to be, and what viewers can expect, in an interview with Entertainment Weekly:

“He called us up. He called the producers and said ‘I heard Steve’s leaving and I would like to be a part of his exit some how. I’d like to be there for it.’ So they were like, ‘Hell’s yeah!’ I think it will be great because Will’s sense of humor is very much in line with our show’s sense of humor.”

Co-star John Krasinski set a high bar for Ferrell to reach; in a recent interview with Parade Magazine, he said:

""No one can replace [Carell]. That goes for him as an actor, because no one has the sense of humor he does, but also there's no person who has his incredible positivity and professionalism, and just a really good heart. So we're losing a friend first and foremost."

In addition to Ferrell, the show's season finale will have two other major guest stars; series creator -- and British series boss -- Ricky Gervais, and Will Arnett. (UPDATE: Ferrell will not appear in the season finale; guest stars Jim Carrey, James Spader, Ray Romano and Catherine Tate, however, will).