Exports rose 2.1% in yuan-denominated terms compared with a year ago, up to 1.17tn yuan ($187bn; Â£121bn).
But imports fell for the eighth month in a row, down 6.7%, taking the trade surplus 45% higher to 284.2bn yuan.
China is the world's biggest trader of goods and a decline in exports has hampered its economic growth.
Last year, the economy expanded at the lowest rate in almost a quarter of a century, growing 7.4%, while 7% growth in the first quarter this year was the worst quarterly gain since the global financial crisis.
But exports also beat expectations in dollar denominated terms, rising 2.8% in the same period.
China's General Administration of Customs said the debt crisis in Greece was having an impact on trade, along with weak demand, rising labour costs and a stronger currency.
Authorities have rolled out a series of measures to boost activity in the economy such as cutting interest rates for the fourth time since November just last month.
The government is set to release growth figures for the second quarter on Wednesday and many economists have forecast that it could slip below 7% - which would be its weakest showing in six years.
Exports in the world's second largest economy, China, have risen, ending three months of decline in June.