If President Obama had gone on The Daily Show any more than he already has to trade quips and banter with Jon Stewart, the two of them might have a buddy movie on their hands.

Oh, sure, there have been tense moments in the past, like the time the smart-ass Comedy Central star called Obama’s policies timid and addressed the Leader of the Free World as “dude” while cautioning him not to say his chief economic adviser was “doing a heckuva job” (echoes of Dubya during Katrina). But overall, it has been a spectacle of brotherly love.

Just a couple of gray-haired 50-something guys enjoying each other’s company.

So it was Tuesday night, as Obama—dressed nattily, as usual, in a trim dark suit, pale-blue shirt, and blue-gray patterned tie—made his third and last appearance on Stewart’s program before the latter leaves it for good a little over two weeks from now.

“You know, I can’t believe that you’re leaving before me,” said the president, who has 18 months left in his second term in the White House.

Ever the showman in these sorts of televised settings, where a worshipful studio audience cheers and laughs at his every utterance, Obama turned to the crowd and announced: “In fact, I’m issuing a new executive order that Jon Stewart cannot leave the show.”

Obama added, apparently self-mockingly: “It’s being challenged in the courts.”

“Yes,” Stewart responded, accepting the challenge to top some prepared presidential shtick. “I have to say for me, this is a states’ rights issue. This is not something that you should be [doing].”

Stewart, by the way, was not above doing shtick of his own. When the president took the stage to a predictably ecstatic audience reaction—his hard-core base was apparently in the house—Stewart observed: “I am amazed and humbled every time I come out here and get that ovation. I’m just happy you were here to witness it.”

Obama chuckled agreeably.

Noting that Obama’s presidential term is also in its endgame, Stewart quipped: “You don’t have that much time to take away Americans’ guns and declare martial law and put hardworking Americans in FEMA camps. If you’re going to do that, you better get started.”

This time the presidential laughter sounded more heartfelt than polite.

Then the president and the comedy show host danced around various policy and political issues large and small—the nuclear deal with Iran, which the president has been selling for the past week practically door to door; the U.S. response to ISIS and the turmoil and violence in the Middle East; the effort to combat global warming; and Stewart’s suggestion that young and even old Americans be required to exhibit some tiny bit of self-sacrifice and enlist in non-military national service.

“And I would be the first one—even old people could do it—I would do it,” Stewart declared.

Obama’s response was prudently noncommittal, given the lack of enthusiasm the voters have shown for such a scheme.

“I think it would be a wonderful idea for us to think about” was basically the president’s reply.

In due course, Stewart changed the subject to the news media, an institution for which this president and any of his predecessors—to say nothing of his successor—generally displays minimum high regard.

“You love them, they love you,” Stewart told Obama with a soup ç on of sarcasm. “So is your frustration sometimes with the media—is the media, myself included, are we focused on the wrong things? Are we demanding too much of you? Are we demanding too much of government? Are we too inflammatory?”

Presented with a slow pitch floating over the plate—never mind that, by most accounts, this presidency has been more threatening to press freedoms than many, many others—Obama swung and connected.

“First of all, the media’s a bunch of different medias.”

Appreciative laughter from the adoring crowd.

“There are some that get on my nerves more than others, I think that’s fair to say. I think the thing that I’m most concerned about is not that it’s unfair or that it’s too tough on government, because I think that’s what journalism and media is supposed to be doing. I think it gets distracted by shiny objects.”

Toward the end of the show, Obama sermonized on the need for “a sense of common purpose” in our politics, which “dissipates...because of all the money and because of all the filters and all the polarizing that takes place...But the only way to prevent that is by getting people involved.”

Stewart rejoined: “I guess what you would say is after seven years, is that the advice that you then bequeath to future President Trump?”

Shiny objects indeed.