Anyone who thinks Republicans and Democrats can't get along needs only to look at the friendship between George W. Bush and Michelle Obama.

The former Republican president has opened up about his wise-cracking relationship with the former Democratic first lady, which was captured in a sweet photo from the opening of the Smithsonian National Museum of African American History and Culture in September.

George W. Bush got a sweet hug from Michelle Obama at the opening ceremony for the Smithsonian National Museum of African American History and Culture on Sept. 24 in Washington, D.C. ZACH GIBSON / AFP/Getty Images

"I'm kind of a needler, and she handles it pretty well,'' Bush told Ellen DeGeneres on her show Wednesday. "(The friendship) surprised everybody. That's what's so weird about society today, (the surprise) that people on opposite sides of the political spectrum can actually like each other."

Trending stories,celebrity news and all the best of TODAY. This site is protected by recaptcha

RELATED: George W. Bush gets candid about whether presidential impressions bothered him

Their shared sense of humor helped them hit it off despite being on opposite sides of the political spectrum. The two have often been seated next to one another at official events like the opening of the African American museum.

"She kind of likes my sense of humor,'' Bush told People. "Anybody who likes my sense of humor, I immediately like. I needle her a little bit and around her, I’m fairly lighthearted. (The Obamas) are around serious people all the time and we just took to each other."

They also have a shared passion for helping U.S. military veterans. The proceeds of Bush's new book, "Portraits of Courage: A Commander in Chief's Tribute to America's Warriors," are being donated to help veterans, while Obama helped create the Joining Forces initiative with Dr. Jill Biden to support service members.

RELATED: Ellen DeGeneres teases George W. Bush about his poncho problem on Inauguration Day

As for Bush's relationship with her husband, former President Barack Obama, it's not quite the same.

"Let's put it this way, he's never given me a hug that way,'' Bush joked to DeGeneres.

Follow TODAY.com writer Scott Stump on Twitter.