An F18 fighter jet crashed on takeoff at a military base near Madrid on Tuesday, killing the pilot - the second time a military plane has come down in Spain in a week.

"The pilot of the airplane has died as a consequence of the accident, which happened during take-off," the Spanish defence ministry said in a tweet following the crash near the Torrejon de Ardoz base, around 20 kilometres (12 miles) from Madrid.

"Rescue teams are on their way to the scene of the accident," a ministry spokesman told AFP, adding that the cause of the crash was as yet unknown.

The pilot was later named by the defence ministry as lieutenant Fernando Perez Serrano.

The accident came just days after the pilot of a Eurofighter jet was killed Thursday on the approach to landing at a military base at Albacete, 300 kilometres southeast of the capital.