If you thought Sen. Bernie Sanders and Larry David were twins, or at least brothers, you’re not far off.

Turns out they’re cousins.

David, the “Curb Your Enthusiasm” star, revealed he was “a third cousin or something” with the 2016 Democratic presidential candidate during a press tour to promote the new season of his irreverently cringeworthy HBO show.

He found out while filming an upcoming episode of “Finding Your Roots,” the PBS show that documents celebrities’ family trees.

“I was very happy about that,” David said at the press event Wednesday.

“I thought there must have been some connection.”

Larry David

Larry David

Both men are Jewish, are around the same age (Sanders is 75, and David is coming up on 70), formed their distinctive accents growing up in Brooklyn — and the resemblance is clear. David had a star turn on “Saturday Night Live” last year playing Sanders, even appearing alongside him in a skit about a ship bound for America.

Fans of “Seinfeld,” which David co-created with comedian Jerry Seinfeld, noticed early on during Sanders’ presidential campaign that he sounded uncannily like David, especially the latter’s imitation of the late New York Yankees owner George Steinbrenner.

At the press event, David said that after the first Democratic primary debate in 2015, “SNL” producer Lorne Michaels began getting calls to have David play Sanders. When Ari Emmanuel, the marquee Hollywood agent, called David to float the idea, David just did his best Sanders impression over the phone. Apparently, he’d been practicing it for a while.

“And every time I watched Bernie Sanders, I would repeat everything that he said, because I know that I can talk like that,” David said at the event. “So I started talking to Ari, the agent, I started talking to him like Bernie.”

While Sanders may have receded a bit from the spotlight after losing the race, David will be back on your TV screen soon. The ninth season of “Curb” begins October 1.