Tesla CEO Elon Musk said he agreed with Recode's Kara Swisher that President Donald Trump screwed him after Musk joined two White House advisory councils, which he left last year after Trump announced he would pull the US out of the Paris climate accord.

"I did my absolute best," Musk told Swisher in an interview for the "Recode Decode" podcast, published Friday.

While on the council, Musk defended his decision to join, saying he'd attempt to lobby for policies addressing climate change and touch on issues like immigration.

Elon Musk again defended his choice to join President Donald Trump's advisory councils, which he left last year, in an interview with Recode's Kara Swisher for the "Recode Decode" podcast, published Friday.

The Tesla CEO said he still thought "it was worth trying" to advocate policies addressing climate change, adding, "I did my absolute best."

Musk has previously defended his choice to join the councils. But this time he acknowledged that he might have gotten a raw deal.

"I said you shouldn't go 'cause he was gonna screw you, remember?" Swisher said, according to a transcript of the interview.

"Well, you were right," Musk responded.

Musk joined the councils shortly after Trump's inauguration but left in mid-2017 after Trump announced he would pull the United States out of the Paris climate accord.

While on the council, Musk said he would attempt to lobby for environmentally sustainable policies and touch on issues like immigration.

Read more: Elon Musk defends his position on Trump's advisory council

"If I stayed on the councils, it would be saying that wasn't important, but I think it's super important," Musk said in a speech to US governors last year, referring to the Paris agreement. "The country needs to keep its word. There's just no way I could stay on after that."

When Swisher asked Musk whether he would do it again, Musk seemed unsure.

"I don't know," he said, "are there councils?"

Listen to Musk's whole interview with Swisher »

Read the full interview transcript »