Japan's economy returned to growth in the second quarter following its first contraction in two years, official figures have shown, but fears of US trade wars clouded the outlook.

The world's third-largest economy grew 0.5% quarter-on-quarter in the April-June period, compared with a 0.2% decline in January-March, the country's Cabinet Office said.

The figure - annualised at 1.9% - was better than market consensus of 0.3% growth, according to data compiled by Bloomberg News.

Private consumption, which accounts for some 60% of Japan's GDP, rose 0.7%, recovering from a 0.2% decline in the first quarter.

The data represented a quick turnaround after a series of eight consecutive quarters of growth ended in January-March, interrupting a winning streak not seen since the heady days of Japan's "miracle" boom of the 1980s.

But analysts warned US-led trade wars could be a major risk factor for an economy still struggling to win a long battle against deflation.