MADRID — Spain pulled out of a two-year recession in the third quarter, with its economy growing 0.1 percent from the previous quarter, according to preliminary data released Wednesday by the Spanish central bank.

While anticipated, the growth news will likely provide a fillip for the conservative government of Prime Minister Mariano Rajoy, which, since coming into office almost two years ago, has pushed through deeply unpopular spending cuts and tax hikes in order to comply with budgetary targets in accordance with Spain’s European partners.

“The worst is over,” said Holger Schmieding, chief economist at Berenberg Bank in London, in a note published Wednesday, noting a turnaround in net Spanish exports.

“One by one, the euro crisis countries are returning to growth after a savage adjustment recession,” he said, noting that Greece, Ireland and Portugal showed signs of expansion earlier this year. Concerning Spain’s prospects, Mr. Schmieding added: “As the slide in domestic demand peters out, the ongoing surge in exports will drive growth.”