The move, announced by Defence Minister Pedro Morenes, sparked new uncertainty about planned deliveries of the cargo plane to national militaries that have ordered it by the dozens.
In a statement, Airbus said it was too early to say how Spain's decision would affect the delivery schedule for the planes, and it was working with military authorities and customers "to manage the situation."
Two pilots and two flight test engineers died in Saturday's crash in the southern city of Seville, where A400Ms are being assembled.
"It's not a good idea for those planes in the production phase and about to do tests to fly without knowing what really happened with the (crashed) plane," Morenes said in an interview with Onda Cero radio.
Spain's air traffic controllers said on Twitter that the pilots had communicated just before the crash that an unspecified problem was affecting the flight.
Some media outlets also quoted Airbus Seville labour union representative Francisco Figueroa as saying the pilot evaded a much worse disaster by landing the plane in a field, avoiding a possible crash into a nearby shopping mall or factories.
"It appears that the pilot made a manoeuvr to try to avoid worse things happening in the accident," Morenes said. The four who died were honoured at a funeral mass at Seville's cathedral on Tuesday.
Morenes said the permits were being temporarily rescinded by Spain's National Institute for Aerospace Technique, which means that A400Ms in final stages of assembly cannot go on test flights.
Morenes declined to provide initial findings of the crash investigation, stressing that the probe will be complicated. Also, a judge in Seville in charge of the crash probe ordered that it must be conducted in secret.
Possible human and technological crash factors will be investigated, Morenes said, adding the possibility that the pilot's manoeuvring of the plane in its final moments in the air might provide clues.
Separately Tuesday, Airbus sought to promote the plane's safety by conducting a test flight of another A400M. The plane flew safely from Toulouse, France, to Seville.
That flight was not affected by Spain's halt on test flights because the plane owned by Airbus is a test plane not scheduled for delivery, said an Airbus official who spoke on condition of anonymity because of company policy preventing the official from being named.
Fernando Alonso, who heads Airbus Defence and Space, took part as a flight engineer in a symbolic show of confidence.
Alonso got his job in January after Airbus dismissed his predecessor following complaints by governments about continued delays in finishing the cargo plane whose rollout went billions over budget and years beyond deadline.
Four of the five countries that already have A400Ms — Britain, Germany, Malaysia and Turkey —grounded the plane after the crash. France, which has six, says it will only use the aircraft in urgent operations.
The 20-billion-euro A400M program saw its first deliveries in 2013. Some 194 aircraft have been ordered by eight countries — including Spain — to replace their aging military transport fleets.
Associated Press writers Angela Charlton and Jamey Keaten in Paris and Alan Clendenning in Madrid contributed to this report.Suggest a correction