OTTAWA - Canada's trade surplus with the world narrowed in February to C$1.04 billion ($824 million) as a global shortage of semiconductor chips hit both imports and exports, Statistics Canada said on Wednesday.

Analysts polled by Reuters had predicted a surplus of C$1.00 billion after a revised C$1.21 billion surplus in January. It was the first time since late 2016 that the trade balance was in surplus for two consecutive months, Statscan said.

Exports were down 2.7%, with exports of motor vehicles and parts decreasing by 10.2% as assembly plants were forced to slow production because of the lack of semiconductor components, Statscan said.

Imports fell 2.4%, with imports of motor vehicles and parts falling 7.8%, again tied to the semiconductor issues.

Canada's trade surplus with the United States widened to C$6.8 billion in February, its largest since September 2008.

The Canadian dollar extended its decline after the data, touching a one-week low of 1.2623 to the greenback, or $79.22 U.S. cents.

(Reporting by Julie Gordon and David Ljunggren in Ottawa; Editing by Andrew Heavens and Steve Orlofsky) ((julie.gordon@thomsonreuters.com; 343-961-4020;))