Spain's Prime Minister Pedro Sánchez has said that after a period of reflection about his future he had decided to continue as the country's leader.
Mr Sánchez said he had informed King Felipe VI of his decision.
Mr Sánchez, in power since 2018, had shocked the nation last week when he announced in a public letter that he was taking several days away from public duty to consider quitting.
He made his announcement on the same day a court said it would investigate his wife, Begoña Gómez, for influence peddling and business corruption, allegations he said were false and orchestrated by his conservative opponents.
His decision to continue draws a line under a week in which Spanish politics was thrown into further turmoil by the prospect of facing another fractious parliamentary vote to choose a new prime minister or even a fourth general election in five years.
A separate court is considering an appeal by Madrid's prosecuting authority to dismiss his wife's case for lack of evidence.
Mr Sánchez insisted his wife was innocent and accused opposition leaders Alberto Núñez Feijóo of the People's Party (PP) and Santiago Abascal of the far-right Vox party of collaborating with those circulating claims against his wife.
He was only reappointed to another term in November.

The court opened its investigation into Mr Sánchez's wife in response to a complaint by anti-corruption pressure group Manos Limpias (Clean Hands), whose leader is linked to the far right.
The group, which has presented a litany of unsuccessful lawsuits against politicians in the past, said in a statement on Wednesday that it had based its complaint on media reports and could not vouch for their veracity.
While the court did not give details of the case, online news site El Confidencial said it was related to her ties to several private companies that received government funding or won public contracts.
Mr Sánchez has said the move against his wife is part of a campaign of "harassment" against them both waged by "media heavily influenced by the right and far right" and supported by the conservative opposition.