With Israeli Prime Minister Benjamin Netanyahu and a throng of dignitaries and well-wishers looking on, a small Israeli spacecraft attempted to pull off the first privately-funded non-superpower moon landing Thursday, but the lander apparently crashed to the surface after engine trouble and communications glitches during the final descent.

"We had a failure in the spacecraft," said Opher Doron, general manager of Israel Aerospace Industries space division, builder of the Beresheet lunar lander. "We unfortunately have not managed to land successfully."

It was not immediately known what went wrong. The descent, from an altitude of about 15 miles, began on time just after 3 p.m. EDT. At that point, the spacecraft was about 500 miles from the intended landing site on a broad plain known as Mare Serenitatis.

Get Breaking News Delivered to Your Inbox

Computer displays in the mission control room in Israel showed Beresheet's thrusters and main engine firing as expected to lower the craft's altitude and slow its forward velocity. The descent appeared to be going smoothly when Doron reported a problem with the craft's inertial measurement unit.

A few moments later, telemetry apparently dropped out. It came back a few moments after that, but problems with the main engine developed and after an uncertain pause, Doron reported the spacecraft was lost.

Just received from SpaceIL communication team what appears to be the last image #Beresheet spacecraft managed to beam to earth before it crashed on the moons surface pic.twitter.com/yDx2ioZiXy — Elad Ratson 🇮🇱 (@EladRatson) April 11, 2019

"You win some, you lose some," said Morris Kahn, president of SpaceIL, the non-profit formed to turn the dream of a commercial moon flight into reality.

"If at first you don't succeed, you try again," Netanyahu said.

Israel had aimed to become only the fourth nation, after the United States, the former Soviet Union and China, to send a spacecraft to a soft landing on the moon. SpaceIL intended the project to generate national pride and inspire Israeli students to pursue STEM educations and careers.

Even though the landing failed, mission managers said the nation should still be proud.

"We are the seventh country to orbit the moon and the fourth to reach the moon's surface," Doron said. "It's a tremendous achievement up to now."

A shot of the moon from Israel's Beresheet spacecraft shortly before contact was lost. It carried a sign with an Israeli flag and the words, "Small country, big dreams." NASA TV

Said Kahn: "Well, we didn't make it, but we definitely tried. And I think the achievement of getting to where we got is really tremendous. I think we can be proud."

NASA Administrator Jim Bridenstine said in a statement the U.S. space agency congratulated SpaceIL, Israel Aerospace Industries and the sgtate of Israel "on the incredible accomplishment of sending the first privately funded mission into lunar orbit."

"Every attempt to reach new milestones holds opportunities for us to learn, adjust and progress," he said. "I have no doubt that Israel and SpaceIL will continue to explore and I look forward to celebrating their future achievements."

Despite modest science goals, the mission generated widespread interest. Enthusiasm was high as the landing approached and the Israeli Airports Authority Thursday included Beresheet on its flight board, listing its destination as "the moon."

An artist's impression of the Beresheet moon lander. SpaceIL

The Beresheet — Genesis — lander, launched Feb. 21 as a secondary payload aboard as SpaceX Falcon 9 rocket, braked into lunar orbit on April 4. With several subsequent rocket firings, flight controllers at Israel Aerospace Industries, builder of the spacecraft, fine tuned its orbit to set the stage for landing.

Mission managers targeted a crater-free 19-mile-wide landing zone in Mare Serenitatis as Beresheet's target, one that is relatively free of obstacles and will be bathed in sunlight to charge the craft's batteries.

Starting at an altitude of about 15 miles, some 500 miles from the landing site, Beresheet's maneuvering thrusters fired to change the spacecraft's orientation, putting its main engine in the direction of travel.

After final checks, the flight computer ignited the main engine to begin the autonomous descent to the surface. But at an altitude of about 8.3 miles, something went wrong and the landing went awry. Exactly what happened, and where the spacecraft ended up, was not immediately known.

With a total cost of about $95 million, including the launch, Beresheet was a bargain-basement planetary spacecraft. To keep costs down, it was built with little in the way of redundancy and its ability to recover from malfunctions was limited.

"The spacecraft will land autonomously," SpaceIL CEO Ido Anteby said before the landing attempt. "Actually, we'll send a command to land, and it will land by itself. We have never tested it, so we are not sure how it will work. We have done a lot of experiments and a lot of tests in the lab using a simulator, but we have never tested the spacecraft to land on the moon."

He warned that the moon landing could be thwarted by a single sensor failure.

The backside of the moon, captured by the Beresheet lunar lander as it braked into orbit around the moon on April 4. Eliran Avital

"In order to begin the landing procedure, we need to give the spacecraft the exact location fo where it is," he said. "This accurate positioning is very risky. We also have a special sensor, a laser sensor. This is the first time that this sensor will be on the moon, so it is very risky, too."

Shortly after launch, engineers ran into problems with one of Beresheet's star trackers and had to cope with unexpected computer resets. But workarounds were developed, and the spacecraft reached lunar orbit in good condition.

Beresheet was equipped with a high-resolution camera to capture panoramic views of the landing site to help scientists better understand the area. The spacecraft also carried a small "time capsule" loaded with photos and cultural artifacts, including a copy of the Bible engraved on a coin-size disk.

"We have a vision to show off Israel's best qualities to the entire world," Sylvan Adams, a Canadian-Israeli businessman and philanthropist who contributed to the SpaceIL project, said before launch.

"Tiny Israel, tiny, tiny Israel, is about to become the fourth nation to land on the moon," he said. "And this is a remarkable thing, because we continue to demonstrate our ability to punch far, far, far above our weight, and to show off our skills, our innovation, our creativity in tackling any difficult problem that could possibly exist."

But for Beresheet, it was not to be.