HANOI - Vietnam posted an $800-million trade surplus in June, much higher than a government estimate of a $100 million deficit for the month, customs data showed on Thursday.

Exports in June fell 0.5 percent from a month earlier to $19.8 billion, while imports decreased 8.3 percent to $19 billion, the customs department said in a report on its website.

First-half exports rose 16.3 percent from a year earlier to $114.2 billion and imports were up 9.6 percent to $110.8 billion, leaving a trade surplus of $3.4 billion for the six-month period, data from the department showed.

Smartphones, garments and computers were among the largest export earners in the January-June period. Key imports were in electronics, machinery and fabrics, the department said.

Last month, the General Statistics Office estimated a trade deficit of $100 million for June.

(Reporting by Mai Nguyen; Editing by Jacqueline Wong)