Emergency service members work in the area where an F-18 fighter jet crashed in Zaragoza, Spain, Saturday, May 20, 2023. AP
The aircraft landed within the perimeter of the base, the defense ministry said on Twitter.
The base, which lies about 10 miles (16 kilometers) outside the city, belongs to the Spanish Air and Space Force.
Videos posted on social media showed a plane in flames falling towards the ground.
The pilot was already in hospital and his life was not in danger, the air force said.
Spain’s public news agency EFE said the F-18 was training for a flying exhibition when the incident occurred.
The Guardia Civil told The Associated Press that one of its patrols was the first to reach the pilot, who fell outside the exterior fence surrounding the airbase.
According to the Guardia Civil, the pilot suffered injuries to his legs, apparently because he ejected with a parachute from a low altitude. He was evacuated to hospital in a helicopter.
The Guardia Civil said it would collaborate with the military in investigating the crash. It said that the initial information provided by the pilot was that the plane had apparently suffered a malfunction.
The American-made F-18 Hornet has formed a part of the air defenses of the United States since the 1980s and has been purchased by the air forces of several allied countries.
Spain’s air force acquired its first 72 models of F-18 manufactured by McDonnell Douglas in 1983. The fighters, known for their versatility, entered service three years later. Spain's air force later purchased an unspecified number of additional F-18s.
The Zaragoza base is home to a unit of Spain’s F-18s.
Spain’s defense ministry did not immediately respond to questions by the AP about incident.