Spain recorded a current account surplus in January-June this year for the first time on record as exports and investor confidence in the recession-hit country strengthened, officials said.
The current-account balance, the broadest measure of a country's trade and financial exchanges with the outside world, showed a surplus of 1.357 billion euros ($1.8 billion) for the first half of 2013, the central bank said.
That contrasted sharply with a shortfall of nearly 17 billion euros in the same period last year.
"This change mainly reflects the notable improvement in the trade deficit, followed by an improvement in returns on investments and services," the Bank of Spain said in a statement.
It was the first time Spain had recorded a surplus for the first half of the year since current records began in 1990, and its first half-yearly surplus since 1997.
Spain's conservative government says the economy, the eurozone's fourth-biggest, is heading out of its two-year recession. The latest growth figures showed the pace of economic contraction slowed in the second quarter.
Friday's data also indicated strengthening investor confidence in Spain, which last year turned to its eurozone partners to bail out its banking sector but resisted pressure to seek a full sovereign bailout.
Spain recorded an investment inflow of 39.8 billion euros in the first half of 2013, compared to an outflow of 225 billion euros in the same period last year.
In trade, the shortfall of exports to imports was less in the first half of 2013, shrinking to 2.71 billion euros from 15.65 billion euros in the first half of 2012, the bank said.
Spain's services sector increased its surplus to 17 billion euros from 15.19 billion euros a year earlier.
In another key sector, tourism, the surplus grew by 4.7 percent to 13.88 billion euros. The industry reported a record number of foreign tourists coming to Spain in July this year.