"I never thought it would ever last this long or come to this," King said. "I'm going to go on, do a lot of other things, we're going to specials here on CNN. I'm going to be seen in other places and do some radio work.
"You're not going to see me go away, but you're not going to see me here on this set anymore. I don't know what to say except to you, my audience, thank you. And instead of goodbye, how about so long?"
Among those wishing King well were former President Bill Clinton and current President Barack Obama.
Network news personalities Brian Williams, Barbara Walters, Diane Sawyer and Katie Couric also said goodbye.
Bill Maher and Ryan Seacrest helped King co-host his surprise-filled farewell.
King has conducted thousands of interviews over his broadcasting career. He joined CNN in 1985 and has recorded more than 6,000 shows for the network.
Piers Morgan, a British talk-show host and "America's Got Talent" judge, will take over the 9 p.m. Eastern time slot in January.
Rival cable station MSNBC saluted King by buying an ad in USA Today on Thursday, calling King "one of a kind."
The Associated Press contributed to this report.