KUALA LUMPUR, Malaysia--Malaysia's June exports rose 7.9% from a year earlier, official data showed Wednesday, backed by higher demand for electronics and petroleum, although shipments to China and Japan declined.

A Wall Street Journal poll of nine economists had predicted a median 13.7% year-over-year gain in exports. In May, exports surged 16.3% from a year earlier.

Exports totaled 61.23 billion ringgit ($19.13 billion) in June compared with 56.75 billion ringgit during the same month last year, the Ministry of International Trade and Industries said in a statement.

In June, exports to Southeast Asia, European Union countries and the U.S. expanded 9.6%, 3.9% and 9.5%, respectively, while shipments to China and Japan fell 1.9% and 2.6%, respectively.

In terms of products, the key electrical and electronics products, which make up about one-third of total exports, grew 5.5% on-year to 20.39 billion ringgit. Exports of liquefied natural gas surged 11.1% to 5.20 billion ringgit, while petroleum products increased 8.3% to 4.98 billion ringgit.

Imports in June climbed 9.2% to 57.26 billion ringgit from a year earlier driven by higher demand for capital, intermediate, and consumption goods, the ministry said. The WSJ poll of economists had predicted a median rise of 12.9% for imports.

Imports of capital goods increased 15.1%, while those of consumption goods rose 7.6%. Imports of intermediate goods--parts such as circuit boards and automotive components used in final assembly of computers and cars--inched up 2.7%.

Malaysia's trade surplus narrowed to 3.97 billion ringgit, its smallest since July last year, from 5.65 billion ringgit a month earlier, the ministry added.

Write to Jason Ng at jason.ng@wsj.com

(END) Dow Jones Newswires

August 06, 2014 00:15 ET (04:15 GMT)

Copyright (c) 2014 Dow Jones & Company, Inc.