Canada's trade deficit widened in May as imports increased slightly and exports remained relatively unchanged.

The country registered a deficit of Can$793 million (US$778 million) in the month, up from Can$623 million (US$611 million) in April, according to Statistics Canada.

It was the second consecutive monthly trade deficit after five months of surpluses.

Imports rose 0.4% to Can$39.7 billion (US$38.9 billion) in May, on the strength of energy products. Imports of crude petroleum and automotive products rose, while telephone equipment and footwear purchases fell.

Exports, meanwhile, remained at Can$38.9 billion (US$38.1 billion) in May as an increase in volumes counterbalanced a decrease in prices. Higher exports of machinery and equipment nearly offset a decline in most sectors.

Exports of aircraft, engines and parts were up a whopping 46%, while crude petroleum sales abroad declined for a fourth consecutive month since a record high in January.

Exports of diesel fuel and motor gasoline, coal and other bituminous substances declined.

Canada's trade surplus with the United States, its main trading partner, also decreased to Can$3.2 billion (US$3.1 billion) in May, as rising imports outpaced exports, which edged up after four consecutive monthly declines.