An Israeli spacecraft rocketed toward the moon for the country’s first attempted lunar landing, following a launch on Thursday night by SpaceX.

A communications satellite for Indonesia was the main cargo aboard the Falcon 9 rocket, which illuminated the sky as it took flight.

But Israel’s privately funded lunar lander — a first not just for Israel but commercial space — generated the buzz.

Israel seeks to become only the fourth country to successfully land on the moon, after Russia, the US and China.

The spacecraft — called Beresheet, Hebrew for Genesis or “In The Beginning” — will take nearly two months to reach the moon.

Israel’s Beresheet moon mission(PA Graphics)

“We thought it’s about time for a change, and we want to get little Israel all the way to the moon,” said Yonatan Winetraub, co-founder of Israel’s SpaceIL, a nonprofit organisation behind the effort.

Within an hour after lift-off, Beresheet was already sending back data and had successfully deployed its landing legs, according to SpaceIL.

The four-legged Beresheet, barely the size of a washing machine, will circle Earth in ever bigger loops until it is captured by lunar gravity and goes into orbit around the moon. Touchdown will be on April 11 at the Sea of Serenity.

The SpaceX Falcon 9 rocket lifts off with Israel’s Lunar LanderThe SpaceX Falcon 9 rocket lifts off with Israel’s Lunar Lander (Craig Bailey/Florida Today via AP)

Nasa’s Apollo missions in the 1960s and 1970s took about three days to get astronauts to the moon, but they used monstrous Saturn V rockets.

The 100 million-dollar Beresheet mission could not afford its own rocket — even a little one — so the organisers opted for a ride share.

That makes for a much longer trip; the moon right now is nearly 230,000 miles (370,000km) away.

“This is Uber-style space exploration, so we’re riding shotgun on the rocket,” Mr Winetraub explained at a news conference on the eve of launch.

The US Air Force also has a small research spacecraft aboard the rocket, for a one-year mission in orbit around Earth.

The Soviet Union was the first to put a spacecraft on the moon, Luna 2, in 1959.

Nasa followed with the Ranger 4 spacecraft in 1962. Last month, China became the first country to land on the far side of the moon.

Apollo 11 moonwalker Buzz Aldrin quickly offered congratulations following Thursday’s launch.

“All the best to @TeamSpaceIL as it starts its journey tonight on a @SpaceX #Falcon9 from Florida to my old stomping ground …the moon,” Mr Aldrin tweeted.

Nasa administrator Jim Bridenstine called it “a historic step for all nations and commercial space as we look to extend our collaborations beyond low-Earth orbit and on to the moon”.

The Beresheet mission originally was part of the Google Lunar XPrize competition and even made the final cut before the contest ended last year without a winner.

The organisers decided to press ahead on their own, with donations from billionaires as well as schoolchildren.

Lunar surface operations are meant to last just two days.

Beresheet will measure the magnetic field at the landing site, and send back data and pictures.

A time capsule is aboard the lander — which includes a picture of Israeli astronaut Ilan Ramon, who died aboard space shuttle Columbia in 2003 — as well as a lunar library containing 30 million pages on a disk from the US-based Arch Mission Foundation.

Mr Ramon’s widow, Rona, was a big supporter of Beresheet; she died of cancer in December.

Following lift-off, SpaceX recovered the first-stage booster, which flew twice last year.

The booster landed smoothly on an offshore ocean platform, after the hottest re-entry yet, according to SpaceX founder and chief executive Elon Musk.

Sparks from burning metal were visible in the landing video.

Mr Musk said the booster will fly a fourth time in April, during a launch abort test of the new crew Dragon capsule. No one will be aboard.