Tom Arnold makes surprise appearance at Comedy Central roast of Roseanne

Roseanne Barr appeared genuinely surprised when ex-husband Tom Arnold took the stage near the end of her Comedy Central Roast taping.

"We have not been in the same room for over 17 years," Arnold told the audience after taking the stage. Largely departing from the typical roast format, most of Arnold's comments toward Roseanne were positive and the pair even hugged after he stepped down from the dais. And while the audience did give Arnold one of the show's few standing ovations of the evening, even he wondered about the wisdom of making the surprise appearance, which Comedy Central officials said was unplanned until just before taping began.

[Related: Roseanne Barr Reunites With Sitcom Kids at Comedy Central Roast]

"Is this really the best format to do this? Getting together with your ex at a roast," Arnold wondered out loud.

But it was clear Roseanne was touched by the appearance.

"I'd really like to thank Tom for showing up. It was very brave and he was very funny," Roseanne said when she took the stage to close out the roast. "But Jesus Christ how many jobs do I have to get that guy?"

The pair had a famously fractious four-year marriage from 1990 to 1994. And for years after their divorce, both Arnold and Barr continued to take shots at each other through the press.

However, Arnold seemingly put any former hard feelings aside and closed out his set with a sentimental tribute to Roseanne, recalling her breakthrough 1985 "Tonight Show" appearance with Johnny Carson that first thrust her into the national spotlight.

"Roseanne you were my Johnny Carson," Arnold said. "Thank you for your thumbs up and for letting me sit on your couch for a little bit."

Although most of the roast was focused on Roseanne's entertainment career, the comedian actress has also been pursuing a longshot presidential bid. On Saturday, she was formally nominated by the Peace and Freedom Party in Los Angeles.

[Related: Comedian Jeffrey Ross Attends Comedy Central Roast Dressed as Joe Paterno]

Closing out the roast, Roseanne joked, "If I can bury my roiling, boiling ceaseless hatred for Tom Arnold maybe there is a chance for world peace."

Watch Roseanne talk about her presidential platform on "Late Night with Jimmy Fallon":