The two countries urged the international community to launch a global response to terrorism, which is particularly essential for Russia and Spain, considering both have suffered at the hands of terrorists.
Russia and Spain also underscored their willingness to boost bilateral anti-terrorist cooperation along the lines of the Organization for Security and Cooperation in Europe - the world's largest security group where Spain will hold the presidency in 2007 - and also within the dialogue between Russia and the European Union, and Russia and NATO.
According to the joint document, Russia and Spain agreed to seek technological assistance from the international community for third countries looking to strengthen their anti-terrorism potential.
The sides decided to share information about the possible access of terrorists to weapons of mass destruction, protect international transportation networks from terrorist attacks, thwart terrorists' financial channels and prevent a merger between terrorism and organized crime.
In his earlier remarks to the Spanish parliament, Putin, who also invited Spanish Prime Minister Jose Luis Rodriguez Zapatero to Russia, said Spain could play an important role in the improvement of relations between Russia and the EU, including in creating a common security space.
"The people of Russia and Spain know what it [terrorism] is," Putin said. "With pain in [our] hearts, we followed events in Spain during the terrorist attacks."
Terrorism became a shared concern for Russia and Spain in the past few years. Almost 200 people were killed in March 2004 when bombers thought to be linked with extremist Islamic groups attacked commuter trains in the Spanish capital, whereas Moscow has repeatedly been targeted by terrorists since federal troops were re-introduced in Chechnya to quell disorder in 1999.
The Russian leader's two-day visit to Spain, which began Wednesday, yielded nine other documents on cooperation in agriculture, sports, anti-drug trafficking, tourism, and civilian space research.