The death of Robin Williams on Monday came just a few months after his return to TV in what was one of the big entertainment stories of last year.

After winning an Oscar for "Good Will Hunting," carrying a rash of hit films and starring in comedy specials for HBO, the improvisational wizard had come back to the place where it all began: network television.

The entertainer was cast in "The Crazy Ones" as the head of a Chicago-based advertising agency who butts heads with his daughter and protegee, played by Sarah Michelle Gellar.

The show teamed TV icons from different eras — Williams, who launched his career in 1978 with "Mork & Mindy," and Gellar, who rocketed to stardom during the late 1990s and early 2000s as "Buffy the Vampire Slayer."

Giving the prospects for success an extra boost was its executive producer, David E. Kelley, the writer and producer behind several hit dramas, including "Picket Fences," "Chicago Hope," "The Practice," "Ally McBeal" and "Boston Legal."

Though the mix of Williams' off-the-cuff stream-of consciousness humor and Kelley's formula of dry humor and topical story lines seemed like an offbeat mixture, CBS was sure that Williams still had the star power to attract a large audience.

In a session at the Television Critics Assn. summer gathering to promote the series, Williams was characteristically upbeat during a panel discussion that included Kelley, Gellar and other cast members. Though he fired off fast quips, he appeared to make a special effort to involve his colleagues in the discussion.

Asked to compare today's crowded TV landscape with the three-network era of "Mork & Mindy," Williams joked, "Well, I mean the last time I was on TV, 'wired' meant a gram and a bottle of Jack Daniels."

In a later interview in the Los Angeles Times, Williams said: "When I started off, there were only three networks. Now there are hundreds. Everybody has their own network. With regular television — not cable — it's interesting to see what you're up against and what you have to do to find an audience."

Kelley, Williams said, had incorporated aspects of Williams' life into his TV character, including rehab and divorce.

Though Gellar usually was the lead in her TV series and movies, she appeared to be fine with playing a supporting role to Williams.

"I don't know if Robin makes me a better parent, or being a parent makes me a better actor opposite Robin, because it's kind of the same thing, which is I have to keep a straight face," she said. "So it's sort of like when my 3-year-old says something really inappropriate and it's really funny but I can't laugh. That's kind of like working with Robin."

Asked during the session what made him happy, the actor replied, "My family, work ... and creating."

"The Crazy Ones” got off to a good start when it premiered, attracting more than 15 million viewers in fall 2013. CBS Entertainment President Nina Tassler was pleased. She told the Wall Street Journal that Williams' co-stars were revving up their line deliveries to keep up with Williams.

"Robin is literally a force of nature," Tassler said. "We wanted the other cast members to settle into their own rhythms and tempos."

For a while, it looked like CBS had another comedy hit with "The Crazy Ones." In the first three weeks, the show averaged 12 million total viewers

But despite the promising start, the audience steadily declined. In its 9 p.m. slot, the series was in a precarious position, competing against ABC’s “Grey’s Anatomy” with no hefty lead-in to give it a boost.

To give the show a lift, "The Crazy Ones" staged a stunt and brought on Williams' "Mork & Mindy" partner, Pam Dawber, as a guest star. The episode marked Dawber's first acting role in 14 years. The stars had seen each other only a few times since the end of "Mork & Mindy" in 1982.

In an interview with TV Guide, the two said they had recaptured their old chemistry. "It's like we never left," said Williams. "And she looks the same." He praised Dawber, who had complained that Mindy was never really developed as a character.

"But you made the show work," Williams said. "You made it safe for me. You were incredible."

Still, "The Crazy Ones" never really caught fire. The show ended its 22-episode run averaging about 8 million viewers. Though it had a loyal following, the series didn’t quite meet the network’s expectations for a show headlining Williams, and it was not picked up for a second season.

“Our world has lost a comic genius, a gifted actor and a beautiful man," said a statement from CBS. "We will remember Robin Williams as one of the unique talents of his time who was loved by many, but also as a kind, caring soul, who treated his colleagues and co-workers with great affection and respect. Our heartfelt thoughts and sympathies go out to his family, loved ones and friends.”