The trade gap was 186.35 billion Moroccan dirham ($19.83 billion) with exports up 6.1 percent and imports down 0.2 percent, Rabat's foreign exchange regulator said on Friday.
Auto and electronics exports rose by 26.2 percent and 26 percent respectively. Energy imports declined by 10.1 percent and wheat imports increased by 51.2 percent after bad weather slashed the local harvest.
Tourism receipts declined 0.4 percent while remittances from the 4.5 million Moroccans living abroad rose 2.2 percent.