Elon Musk, the billionaire CEO of Tesla and SpaceX, attended a fundraiser retreat in Wyoming that was hosted by Republican House Leader Kevin McCarthy, Fox News has learned.

The event was held at a resort in Teton Village, near Jackson Hole, Wyoming, and happened on the same day Wyoming Rep. Liz Cheney lost a primary election to Trump-backed Republican nominee Harriet Hageman.

A source told Fox News that McCarthy and Musk led a fireside chat with supporters, House members and Republican candidates. 

The event was closed to the press. 

VOTERS DECIDE PRIMARY ELECTIONS IN WYOMING AND ALASKA: LIVE UPDATES

Elon Musk speaks at SpaceX press conference

Elon Musk gestures as he speaks during a press conference at SpaceX's Starbase facility near Boca Chica Village in South Texas on February 10, 2022. (JIM WATSON/AFP via Getty Images)

The National Republican Congressional Committee fundraising event was hosted "practically in Cheney's backyard," Business Insider reported.

The event comes as Musk has embraced the Republican Party in recent months and has become more politically vocal over Twitter. Musk is currently embroiled in a legal battle over his $44 billion deal to purchase the social media giant.

Publicly, McCarthy refused to confirm or deny Musk’s attendance at the event. The Republican leader clarified that the event was open for "members, donors and candidates."

TRUMP BLASTS LIZ CHENEY AFTER PRIMARY LOSS TO HARRIET HAGERMAN: 'SHE CAN FINALLY DISAPPEAR'

A photo of Kevin McCarthy pointing while speaking

House Minority Leader Kevin McCarthy, R-CA, answers questions during a press conference at the U.S. Capitol on July 29, 2022, in Washington, D.C.  (Win McNamee/Getty Images)

Musk and McCarthy share a unique relationship as SpaceX conducts operations in Bakersfield, California, which falls within the district McCarthy represents. 

Previously, Musk has donated to both parties and has previously said he has voted for Democrats. Earlier this year, Musk revealed that he voted for a Republican candidate for the first time ever. He said he cast a ballot for Mayra Flores who claimed victory in the special election for Texas' 34th Congressional District.

Musk also also previously predicted a massive red wave is coming in 2022 and suggested he is leaning toward voting for Florida Gov. Ron DeSantis for president, should he decide to run in 2024.

CLICK HERE TO GET THE FOX NEWS APP

Liz Cheney in Jackson, Wyoming

Rep. Liz Cheney, R-WY, gives a concession speech to supporters during a primary night event on August 16, 2022 in Jackson, Wyoming.  (Alex Wong/Getty Images)

On Tuesday evening, just before the Wyoming retreat was set to begin, Musk tweeted that he was a supporter of "the left half of the Republican Party and the right half of the Democratic Party."

Former Department of State spokesperson Morgan Ortagus posted a selfie with Musk on Tuesday night. She captioned it, "Bucket list #selfie. Thank you @elonmusk." 

It's unclear exactly where the picture was taken.