"The government has decided against proceeding with the extradition of Dogan Akhanli as called for by Turkey," Spanish Deputy Prime Minister Soraya Saenz de Santamaria said.
Reacting to Spain's decision, the author told German daily Kolner Stadt Anzeiger: "I'm very relieved. This is what I've been waiting for."
Akhanli, 60, has lived in Germany since 1991. He was arrested in August while on holiday in southern Spain following an Interpol warrant initiated by Ankara accusing him of "terrorism", his lawyer said.
After Berlin objected, Akhlani was released but instructed to remain in Spain until a decision was made on his extradition.
He says Turkey wants to arrest him for his books on the mass killings of Armenians during World War I and the rights of Turkey's Kurdish minority.
Akhlani's arrest followed the detention of journalist Hamza Yalcin by Spanish police on a Turkish warrant on charges of insulting President Recep Tayyip Erdogan and of having links to an unspecified "terror group".
The joint Swedish-Turkish national was freed last month and Spain said he would not be extradited to Turkey due to his refugee status in Sweden.
Turkey ranks 155 on Reporters Without Borders' latest press freedom index, below Belarus and the Democratic Republic of Congo, after dropping four places from its 2016 ranking.