In a statement, Eduardo Torres-Dulce cited "personal reasons" for his decision, according to Spain's El Mundo newspaper.
However, his resignation come in the context of strained relations between the prosecutor and Spain's Justice Minister Alberto Ruiz-Gallardón as well as the current incumbent Rafael Catalá.
His decision to step down also comes in the wake of intense pressure on him by Spain's conservative Popular Party (PP) government to take action against the president of Catalonia Artur Mas after the Catalan government went ahead with a symbolic November 9th independence vote despite Madrid suspending that vote in the courts.
On Thursday, a spokesperson for Spain's major opposition party, the Socialists said the government "had made" Torres-Dulce resign "out of fear".
"The prosecutor has resigned because the government pressured him," Antonio Hernando said in comments cited by Spain's 20 minutos newspaper. Hernando went on to say that the PP's treatment of Torres-Dulce was indicative of the government's desire to control all state institutions.
As early as November 11th, or two days after the vote in Catalonia, the head of the PP in Catalonia, Alicia Sánchez-Camacho, said in a press conference a suit against Mas had been "almost finalized" by Torres-Dulce's Catalan counterpart.
But the Madrid-based state prosecutor-general instead made a call for calm, saying Catalonia's public prosecutor would "first look at whether if any crimes had been committed, then determine what those crimes are and finally who might be responsible".
"The time frames of the Public Prosecutor and justice are not those of politicians and the media," he told journalists.
The Catalan public prosecutor's office then decided not to push ahead with legal action, arguing there were insufficient legal grounds to do so.
This saw Torres-Dulce going to fellow state prosecutors for backing for a suit against Mas.
In late November, Torres-Dulce accused the Catalan president of offenses such as grave disobedience, abuse of power and misuse of public funds in connection with the ballot.
Catalonia’s top court, the TSJC, will now consider the possibility of investigating Mas and any eventual charges he might have to face. Other private prosecutors have already lodged complaints against the Catalan leader over the rebel ballot.
In the official prosecutors’ complaint, Catalonia’s deputy president, Joana Ortega, and the region’s education chief, Irene Rigau, are also cited, the latter in connection with the use of public schools all over the region to hold the vote.
Torres-Dulce is now set to return to his position as a prosecutor with Spain's Constitutional Court.