Belgian Prime Minister Charles Michel

Belgian Prime Minister Charles Michel reshuffled his cabinet on Sunday after the Flemish nationalist N-VA walked out of the government in protest at his decision to endorse a UN migration deal.

The move leaves Michel in charge of a shaky minority government that will have to rely on opposition votes in parliament. Belgian federal elections are due in May 2019.

At the heart of the government crisis is the UN Global Migration Compact, which world leaders are due to endorse at a meeting in Marrakech starting Monday. Several countries have backed out of the non-binding accord, which aims to regulate migration.

Michel had pledged in September to endorse the deal, but since then the nationalist N-VA voiced its opposition, vowing that it could not remain in government if the premier went ahead.

Belgium's King Philippe accepted the resignation of the three N-VA cabinet members, Interior Minister Jan Jambon, Finance Minister Johan Van Overtveldt and Defence Minister Sander Loones, as well as state secretaries Theo Francken and Zuhal Demir, the Royal Palace said.

The king promoted secretaries of state Peter de Crem and Philippe De Backer to ministerial posts, according to a statement issued after he met with Michel.

Maggie de Block, minister for health and social affairs, is due to inherit the asylum and migration portfolio, a post she had previously held, the Belga news agency reported.

Vice premier Alexander De Croo is to take over as finance minister, while secretary of state Peter de Crem will be promoted to interior minister.

Foreign Minister Didier Reynders is due to add the defence ministry to his portfolio, Belga reported, citing sources close to the premier. The VRT broadcaster had reported earlier that it could go to Denis Ducarme, whose oversees the agriculture ministry among others.

Disagreement over the compact has also shaken other European governments. Last week, Slovakian Foreign Minister Miroslav Lajcak tendered his resignation after his country rejected the accord.

Hungary, Austria, Italy, Bulgaria, Croatia, the Czech Republic, Poland and Switzerland have all publicly rejected the agreement.