(Adds details on deficit as percentage of GDP, background on trade surplus)
BRASILIA, May 23 (Reuters) - Brazil's posted a current account surplus in April for the second straight month, central bank data showed on Tuesday, as record harvests boosted exports and helped limit currency losses during a deepening political crisis.
The surplus came to $1.153 billion in April, the central bank said. That was roughly in line with the median estimate of $1.25 billion from a Reuters poll of economists.
Latin America's largest economy attracted $5.577 billion in foreign direct investment in March, slightly above forecasts of $5.35 billion in the Reuters poll.
A sharp drop in imports after two years of recession and an increase in exports boosted by a weaker real and bumper crops of soy and corn pushed the trade surplus to a record $7 billion last month.
The recent improvement in Brazil's external accounts has limited currency losses despite the political crisis. President Michel Temer has resisted growing calls for his resignation after the disclosure last week of a recorded conversation in which he appeared to condone the payment of hush money to a jailed lawmaker.
In the 12 months through April, Brazil had a current account deficit equivalent to 1.06 percent of gross domestic product, down from 1.10 percent in March. (Reporting by Marcela Ayres; Writing by Silvio Cascione; Editing by Chizu Nomiyama and Lisa Von Ahn)