Craig Ferguson's nights of dancing with Secretariat the pantomime horse are numbered.

The Scottish-born host of CBS' "The Late Late Show" told his studio audience during Monday's taping that he will leave in December when his current contract expires.

"CBS and I are not getting divorced, we are 'consciously uncoupling,'" the 51-year-old comic joked in a statement issued by the network. "We will still spend holidays together and share custody of the fake horse and robot skeleton, both of whom we love very much."

Since he took over in 2005, Ferguson has developed "Late Late Show" into one of the most idiosyncratic shows in late night. Known for his digressive, ad-libbed monologues, Ferguson also converses nightly with a robotic skeleton sidekick named Geoff and has been known to interview guests while chomping on an unlighted pipe.

But Ferguson's future on CBS grew cloudy after reports earlier this month indicated the network had approached former "Daily Show" guest host John Oliver to take over the 12:35 p.m. slot (Oliver landed at HBO, where his new series, "Last Week Tonight," debuted on Sunday).

CBS also recently announced that Stephen Colbert will take over for "Late Show" host David Letterman in the 11:35 p.m. slot some time next year, which some Ferguson fans interpreted as a slight. But Ferguson himself has publicly been gracious about the matter, congratulating the "hugely talented and fragrant" Colbert on Twitter.

In a statement, CBS Entertainment Chairman Nina Tassler praised Ferguson for elevating CBS to "new creative and competitive heights at 12:30" and for infusing "The Late Late Show" "with tremendous energy, unique comedy, insightful interviews and some of the most heartfelt monologues seen on television."

In an interview Monday with Variety, Ferguson attempted to quash the notion that his departure had anything to do with the impending takeover of "The Late Show." He said he began plotting an exit from CBS two years ago, well before Letterman's retirement was in the works, and that his late-night farewell had more to do with creative stamina than sour grapes.

"Ten years is a very long time in one job — for me. I wanted to leave the show before I stopped enjoying it. That was my goal. I didn't want it to be a chore," he said.

Ferguson's departure from "The Late Late Show" marks an end to the latest chapter in an unlikely showbiz career. Before he entered TV, Ferguson was a drummer in a Glasgow punk band called the Dreamboys; among his band mates was Peter Capaldi, who now plays the title role in the British sci-fi series "Doctor Who" and encouraged his friend to try comedy.

Ferguson eventually moved to Los Angeles and had his major American breakthrough on "The Drew Carey Show," where he played Carey's eccentric English boss from 1996 to 2003.

He was later tapped to replace Craig Kilborn as host of "The Late Late Show" in 2004. "The Late Late Show" earned a Peabody Award in 2009, and as a host Ferguson has been praised as much for his sharp wit as for his occasionally poignant monologues. He eulogized his parents following their deaths, and also spoke movingly about Boston after the marathon bombings last year.

Ferguson has also been frank about his struggle with alcoholism, vowing in 2007 not to make any jokes at the expense of the "vulnerable" Britney Spears, then in rehab. He wrote about addiction in his 2009 memoir, "American on Purpose: The Improbable Adventures of an Unlikely Patriot."

Under Ferguson, "The Late Late Show" notched the best ratings in the 19-year history of the franchise, with the host occasionally beating Conan O'Brien and his "Late Night" successor Jimmy Fallon. But since Fallon's promotion to "The Tonight Show," Ferguson's ratings have dipped opposite new rival Seth Meyers, averaging about 1.35 million a night.

While there is no clear successor in line to take over for Ferguson, CBS Chief Executive Les Moonves said in an interview this month that the network is considering a wide variety of candidates for the slot, including women. Host Chelsea Handler is reportedly eager to leave E! once her contract at the network expires later this year, and sparked rumors earlier this month by posting a photo of herself on Instagram with a stack of papers from CBS on her lap.