Tesla and SpaceX CEO Elon Musk said he will stay on two of President Donald Trump's advisory councils despite fierce public outrage and pressure to step down over the president's recent controversial immigration order.

Musk's statement came just hours after Uber's chief executive Travis Kalanick quit the council on Thursday.

In a lengthy statement posted on Twitter on Thursday, Musk said he and others will "express our objections to the recent executive order on immigration and offer suggestions for changes to the policy" during their first meeting on Friday.

During his first week in the Oval Office, Trump signed an executive order temporarily suspending America's entire refugee programme, barring Syrian refugees indefinitely from entering and restricted immigrants from seven Muslim-majority countries from entering the US. The travel ban sparked severe backlash and triggered protests across the country and around the world.

Major tech companies including Microsoft, Facebook and Google among others quickly voiced their opposition to the order and raised serious concerns over its impact to their businesses, employees and ability to competitively recruit talent from overseas.

Musk, who agreed to join Trump's advisory councils in December, said that serving in the council "does not mean that I agree with actions by the Administration."

"My goals are to accelerate the world's transition to sustainable energy and to help make humanity a multi-planet civilization, a consequence of which will be the creation of hundreds of thousands of jobs and a more inspiring future for all," Musk said.

"I understand the perspective of those who object to my attending this meeting, but I believe at this time that engaging on critical issues will on balance serve the greater good."

Donald Trump
US President Donald Trump meets with business leaders in the Roosevelt Room at the White House in Washington, DC, on January 23, 2017. Nicholas Kamm/AFP/Getty Images

In December, Kalanick and Musk agreed to join Trump's Strategic and Policy Forum, a 19-member economic advisory council, which also includes Pepsi CEO Indra Nooyi, Disney chief executive Bob Iger and Walmart's Doug McMillon.

However, Kalanick opted to drop out of the group on Thursday following criticism from employees, customers and activists for not taking a tougher stance on the immigration order.

People accused Uber of undermining a work stoppage called by the New York Taxi Workers Alliance last weekend to oppose the Muslim travel ban. Paired with Kalanick's position in Trump's economic advisory, the ride-hailing service's decision to continue operating and disable surge prices during the work stoppage led thousands of users and celebrities to pledge to #DeleteUber en masse - a hashtag that quickly went viral.

"Joining the group was not meant to be an endorsement of the president or his agenda but unfortunately it has been misinterpreted to be exactly that," Kalanick said in an email to staff. "We must believe that the actions we take ultimately move the ball forward. There are many ways we will continue to advocate for just change on immigration but staying on the council was going to get in the way of that."

Following the campaign, Kalanick pledged to create a $3m (£2.4m) defence fund to help drivers affected by the president's order.

"The executive order is hurting many people in communities all across America," Kalanick wrote. "Families are being separated, people are stranded overseas and there's a growing fear the U.S. is no longer a place that welcomes immigrants.

"We will fight for the rights of immigrants in our communities so that each of us can be who we are with optimism and hope for the future," he said.