F-35A Lighting II aircraft assigned to the 388th Fighter Wing at Hill Air Force Base, Utah, fly in formation over the Utah Test and Training Range, March 30, 2017. Air Force photo by R. Nial Bradshaw

A US F-35 stealth fighter plane was completely destroyed in a crash during training on Friday, officials said. The pilot safely ejected.

The crash is the first of its kind for the troubled F-35 program, marking an unfortunate moment for the most expensive plane in history.

The Marine Corps said in a statement that a Marine Corps F-35 had crashed around 11:45 am (1615 GMT) outside Marine Corps Air Station Beaufort in South Carolina.

“It’s a total loss,” one official said.

Images on social media show a plume of black smoke rising above what users said was a crash site.

The crashed plane was an F-35 “B” variant, used by the Marine Corps and capable of taking off from a short runway and landing vertically. The Air Force and Navy have their own models.

The Beaufort County Sheriff’s Office said the pilot safely ejected and was being evaluated for injuries.

Unit costs vary, but the price tag of F-35s is around $100 million each. Future production lots of F-35s are projected to drop slightly in price.

The crash comes just one day after the US military first used the F-35, which has been beset with delays and cost overruns, in combat. Multiple Marine Corps F-35s struck Taliban targets in Afghanistan.

Launched in the early 1990s, the F-35 program is considered the most expensive weapons system in US history, with an estimated cost of some $400 billion and a goal to produce 2,500 aircraft in the coming years.

Once servicing and maintenance costs for the F-35 are factored in over the aircraft’s lifespan through 2070, overall program costs are expected to rise to $1.5 trillion.

Proponents tout the F-35’s radar-dodging stealth technology, supersonic speeds, close air support capabilities, airborne agility and a massive array of sensors giving pilots unparalleled access to information.

But the program has faced numerous delays, cost overruns and setbacks, including a mysterious engine fire in 2014 that led commanders to temporarily ground the planes.

So far, the US military has taken delivery of 245 F-35s, most of them to the Air Force.