Jon Stewart, five years before being outed for meeting privately at the White House, joked with President Obama about hanging out together in the West Wing and why it was a bad idea.

When Obama appeared on "The Daily Show" Oct. 27, 2010, they discussed the administration's practice of making all White House visitors public.

"Did you just invite me to the White House?" Stewart interjected.

"No, no. Because we'd have to disclose it and I don't think you would actually…" Obama responded.

"Right," Stewart came back. "You don't want people knowing I was over there," to which Obama nodded and said "exactly."

Politico reported this week that Obama twice invited Stewart to the White House, most recently in February 2014, and that Stewart's name appears in the visitors' log. However, the first visit was a year after the duo joked about Obama's non-invitation and, ironically, went unnoticed for four years.

On Tuesday, Stewart went on Comedy Central's "The Nightly Show" to address the hubbub created by the Politico story.

"I don't know if they were secret," Stewart told host Larry Wilmore on Tuesday. "I'm in the visitor log."

On Wednesday, Stewart — in one of his final shows before he turns over the reins to Trevor Noah on Monday — stressed that the meetings weren't secret.

"Something is not a secret just because you don't know about it," Stewart said.