The plane reportedly hit an electric power line as the pilots tried to make an emergency landing.
The survivors have been taken to hospital by helicopter. A Spanish interior ministry spokesman told The Associated press news agency that one person had been conscious when they were taken out of the wreckage.
Mr Rajoy said the government was ready to support the families of all of those involved in the accident.
The accident took place in a field just north of San Pablo airport. According to local media, the crash site is close to the Airbus manufacturing plant which assembles the planes.
The Airbus A400M plane model is not yet used by the Spanish military. It is a large transport aircraft that has been ordered by eight countries including Spain to replace a fleet of ageing Hercules aircraft.
Airbus has said that the plane that crashed had been ordered by Turkey.
Local media report that the Spanish government has also agreed to buy 27 of the planes, with the first one due to be delivered to the military next year