France and Spain have agreed to create a joint cross-border intelligence team to combat what Nicolas Sarkozy, the French president, called "the cancer of terrorism".
Sarkozy and Jose Luis Rodriguez Zapatero, Spain's prime minister, announced the decision to form the new team after a bilateral summit in Paris on Thursday.
The move comes a month after police caught two Basque separatists suspected of killing two Spanish officers in France.
Both nations have also been targeted by radical groups from North Africa, with an al-Qaeda affiliate based in Algeria recently threatening to attack the two countries.
The agreement foresees the creation of a permanent Franco-Spanish intelligence team charged with fighting terrorism "in all its forms" the French president's office said in a statement.
"France will always be beside Spanish democracy in the face of the cancer of terrorism, whether it is internal terrorism or external terrorism,'' Sarkozy told a news conference.
Zapatero said the agreement was aimed at preventing attacks, and warned that Eta, the Basque separatist organisation, would suffer the "consequences" of abandoning a ceasefire last year.
France and Spain also agreed to conduct joint operations to send home illegal immigrants, but gave no details on how the expulsions would be carried out.
Zapatero called it logistical co-operation.
The Franco-Spanish summits were set up in 1985 on the occasion of Spanish King Juan Carlos's visit in France.
The last summit was held in the Spanish city of Girona in November 2006.