Musk said in a tweet on the X platform in response to a tweeter who referred him to Hamas's invitation to visit Gaza: "The situation seems a bit dangerous right now, but I think that Gaza's long-term prosperity will be good for all sides."

A senior Hamas official invited the American billionaire on Tuesday to visit the Gaza Strip to see the extent of the devastation caused by the Israeli bombardment.

Osama Hamdan, a senior Hamas official, told a news conference in Beirut: "We invite him to visit Gaza to see the scale of the massacres and destruction committed against the people of Gaza in compliance with the standards of objectivity and credibility."

On Monday, Musk toured the site of Hamas's attack on Israel and declared his commitment to do whatever was necessary to stop the spread of hatred.

Musk's visit to the occupied territories comes after the White House condemned what it called "anti-Semitism" by Musk and his popular platform X-Twitter, after liking a post that several rights groups said referred to an old conspiracy theory and encouraged hatred.