(CNN) - John McCain has learned his lesson: Don't ever cancel on David Letterman.
Appearing on the late night comedian's show Thursday, the Republican presidential candidate apologized for skipping out on a scheduled visit late last month that Letterman later made the subject of an ongoing joke.
"I screwed up," McCain told Letterman more than once in the interview that's set to air Thursday night.
McCain's appearance on the show comes three weeks to the day after after he raised the ire of the generally mild-mannered host by canceling at the last minute, citing his decision to suspend his presidential campaign because of the financial crisis.
"This doesn't smell right," Letterman said then, during a routine that only half appeared to be a joke. "This is not the way a tested hero behaves. Somebody's putting something in his Metamucil."
Letterman also didn't appear to buy the Arizona senator's explanation for the cancellation then, showing the audience a live feed of McCain preparing for an interview with CBS anchor Katie Couric. After praising McCain's record as a prisoner of war in Vietnam, he said, "This is not the John McCain I know, by God."
Letterman has repeatedly harped on McCain for the missed appearance, noting the Arizona senator's poll numbers appeared to begin to slide right after he skipped out on the show.
"Look at all the conversation I gave you. Including having Mr. Olbermann on," McCain told Letterman Thursday night, referencing the MSNBC liberal talk show host who filled in for him that night.
But Thursday's interview was not all fun and games, as Letterman pressed McCain on Republican VP Sarah Palin's preparedness to lead the country through "the next 9/11 attack.."
"Absolutely" she is, McCain said. "She has inspired Americans. That's the thing we need."