Hillary Clinton yukked it up with Stephen Colbert in an unannounced appearance on The Colbert Report on Tuesday night, topping the comedian in a name-dropping contest and using "Old McDonald Had a Farm" to share her secrets to diplomacy.

The former secretary of state and Democratic presidential frontrunner played it safe with the visit, which came as part of the marathon promotional tour for her book, Hard Choices. Rather than the freewheeling interviews that Colbert does with many of his end-of-show guests, Clinton's mid-show segment appeared to be entirely scripted.

While Clinton hammed it up to the crowd's delight, the script steered clear of any politically sensitive topics.

Walking out on the stage with the studio audience chanting her name, Clinton jumped right into the name-dropping tit-for-tat with Colbert, which culminated, a bit too predictably, with that other famous Clinton.

"I will have you know, madam, that I once did an entire show with President Bill Clinton," Colbert said.

"I hate to break this to you, Stephen," Hillary replied, "but I've met him, too."

The 8-minute segment ended with Clinton telling Colbert he had to promote her book, "or I won't appear on your show." When Colbert balked, Clinton snapped her fingers and her face became blurred out, leading him to, of course, relent.

While the appearance was a "surprise," Colbert teased it on Twitter around the time of the late-afternoon taping, several hours before the show aired.

You can watch the full segment below.