Brazil posted a current account surplus of $1.354 billion in August, way below the surplus of $2.184 billion recorded in the same month a year ago, the central bank said on Friday.

Still, the result was higher than the $800 million median forecast of 19 economists surveyed by Reuters. The estimates ranged from $300 million to $2 billion.

The August figure compared with a deficit of $717 million in July, the worst since April 2004. Altamir Lopes, head of economic research at the central bank, forecast the current account surplus for September at about $1.3 billion.

In the 12 months through August, Brazil posted a current account surplus equal to 0.90 percent of gross domestic product compared with 0.99 percent through July.

In the 12 months through April, the current account surplus was equivalent to 1.37 percent of gross domestic product, compared with 1.23 percent in the 12 months through March.

Foreign direct investment in Brazil, Latin America's largest economy, nearly doubled in August from a year earlier to $2.04 billion from $1.18 billion, the central bank said.

The result matched the $2 billion median estimate of 11 analysts in the Reuters survey. The estimates ranged from $1.2 billion to $2.5 billion.

Lopes said foreign direct investment in September through this Friday was at $950 million and should reach $1.3 billion by the end of the month.

The central bank raised its forecast for foreign direct investment in 2007 to $32 billion from a previous estimate of $25 billion and cut its expectation for the current account surplus this year to $7.8 billion from $10.7 billion.

For 2008, the central bank forecast a current account surplus of $3.2 billion and foreign direct investment of $28 billion.

The current account balance tracks a country's net flow of external transactions, including foreign trade, interest payments and services such as tourism. It is used to gauge a country's dependence on foreign capital. DOLLAR OUTFLOWS

Brazil had $1.044 billion in net outflows of U.S. dollars this month through Sept. 19 as foreign investors reduced their holdings of local securities, the central bank said.

Brazil had net dollar outflows of $2.823 billion from financial transactions in the period, while inflows from trade-related transactions reached $1.779 billion through Sept. 19, the central bank said.

Banks cut their long dollar positions to $793 million through Sept. 19 from $1.72 billion at the end of August. A long position on the dollar is a bet that the currency will strengthen against the real. (For details on Brazil's August current account figures, see: http://www.bcb.gov.br/?ECOIMPEXT)