South Africa posted the biggest trade surplus since at least 1996 in May as exports of precious metals and stones surged. The trade surplus widened to 18.7 billion rand ($1.27 billion) from a revised deficit of 130 million rand in April, the Pretoria-based South African Revenue Service said in an e-mailed statement on Thursday. The median of 10 economist estimates compiled by Bloomberg was for a surplus of 4.1 billion rand. A recovery in exports, which are starting to benefit from the rand’s 21 percent decline against dollar over the past 18 months, could help narrow the deficit on the current account that swelled to 5 percent of gross domestic product in the first quarter. Africa’s most-industrialized economy has been weighed down by low metal prices, the worst drought in more than a century and weak demand from the nation’s main export markets. Domestic output contracted 1.2 percent in the first quarter. “The big surprise came from the precious metals component, which rose 49 percent month-on-month”, Carmen Nel, an economist at FirstRand Ltd’s investment banking unit, said by phone from Cape Town. “It may reflect the cyclical under-performance in precious metals exports in recent months and quarters.” Exports rose by 14 percent to 104.7 billion rand, led by the jump in precious metals and a 27 percent increase in vegetable shipments. Imports dropped by 6.6 percent to 86 billion rand. Exports have risen 10 percent this year to 452 billion rand compared to the same period in 2015. The rand strengthened after the data was released and was 0.7 percent stronger against the dollar at 14.6940 by 6:30 p.m. in Johannesburg. An increase in interest rates by the central bank and a decline in consumption are “allowing for imbalances within the local economy to be adjusted to a degree,” ETM Analytics economist Manisha Morar said by phone from Johannesburg. “With the external deficits compressing, it will over time support a more balanced economy and one that provides a better backdrop against which the rand is traded,” she said.