WASHINGTON — A Marine Corps F-35B Lightning II fighter jet crashed near the service’s air station in Beaufort County, South Carolina on Friday morning during a training flight, according to the Marine Corps.

The pilot safely ejected from the fifth-generation fighter jet, which crashed about 11:45 a.m. near the Broad River, about five miles from Marine Corps Air Station Beaufort, the Corps said in a statement. The pilot, from 2nd Marine Aircraft Wing, was being examined Friday afternoon by medical personnel.

The aircraft was a total loss, according to a Marine official, who spoke on condition of anonymity. An investigation into the incident could take months to determine the cause, the official said.

Kensley Crosby, a Beaufort resident who lives near the area where the F-35B crashed, told the Beaufort Gazette newspaper that she heard an explosion and saw smoke coming from the scene. Kensley said she heard three to four additional explosions within 30 minutes of the crash.

MCAS Beaufort has one F-35B squadron, Marine Fighter Attack Squadron 501. It is also home to five squadrons that fly various versions of F/A-18 Hornet fighter jets.

The crash is the first of an F-35 during a training or operational flight, a Pentagon official said. The F-35 program, the most expensive weapon in U.S. military history, has been marred by delays and cost overruns and other mechanical issues. Problems include a broken bracket that was blamed for an in-flight fire on a Marine F-35B in October 2016 at MCAS Beaufort, according to a Marine Corps investigation into the incident. The plane successfully landed, but the aircraft was lost.

The crash on Friday came one day after an American F-35 was used for the first time in combat to strike an enemy target. On Thursday, a Marine F-35B successfully attacked a Taliban target in support of a ground clearance operation in Afghanistan, according to the Marine Corps. The F-35Bs involved in that operation flew from the USS Essex, an amphibious assault ship in the U.S. Central Command area of operations.

The Marine version of the F-35 is capable of conducting short takeoffs and vertical landings like a helicopter. The Air Force and Navy have their own versions of the aircraft but have yet to use them in combat.

The F-35 program is expected to cost the Pentagon about $406 billion for 2,456 fighter jets that the services intend to buy, according to the F-35 Joint Program Office.

The Marine Corps version is the most expensive of the three versions of the F-35, costing about $115.5 million in 2019. Pentagon and Lockheed Martin officials announced Friday that they had reached an agreement to reduce the price of the 141 F-35s set to be delivered in the next year.

Ultimately, the Air Force intends to purchase 1,763 F-35As, the Marine Corps intends to buy 353 F-35Bs and the Navy plans to buy 340 F-35Cs designed for deployment on aircraft carriers.

dickstein.corey@stripes.com

Twitter: @CDicksteinDC

