Belgium's king on Friday accepted the resignation of Prime Minister Charles Michel but asked the premier to stay on at the head of a caretaker government until elections are held in May, Belgian media reported.

After two days of talks with political party leaders, King Philippe had noted a willingness among them to guarantee the good functioning of government on day to day business, state broadcaster RTBF said, quoting Royal Palace sources. The Royal Palace wasn't immediately available to confirm the report. Belgium is due to go the polls on May 26.

The king asked the leaders to ensure that the government can smoothly handle a number of files in coming months, chief among them the 2019 budget.

Michel, who turned 43 on Friday, submitted his resignation on Tuesday as pressure built on his government after the biggest party in his coalition party quit over his support for a U.N. migration pact.

Belgium is no stranger to political chaos, and building a coalition and Cabinet that respect the balance between parties from the Dutch-speaking north of the country, Flanders, and French-language Wallonia has proved a trial for many administrations.

The kingdom went for 589 days without a government in 2010-11 — a world record at the time — because politicians in Flanders, the more wealthy part of Belgium that makes up almost 60 percent of the total 11.5 million population, and Wallonia, couldn't agree on a policy program following elections.

Belgium also has a small German-language community.

But it's the first time that Philippe has faced such a crisis. He ascended to the throne in 2013 after his father, King Albert II, abdicated for health reasons.

This time around, the Flemish right-wing N-VA party quit after Michel sought parliamentary approval for the U.N. Global Compact against its wishes, branding his new minority government "the Marrakech coalition," after the city where the migration treaty was adopted on Dec. 10-11.

The accord is non-binding, but the N-VA said it still went too far and would give migrants who were in Belgium without authorization many additional rights.

Over the last two days, various party leaders suggested that the N-VA is simply too big an obstacle for Michel's minority government to work around, but they were also reluctant to call snap elections when polls are due in five months anyway.

A noisy but relatively small yellow vest movement in Belgium has been calling for his resignation, but their at times violent protests appear to have had little or no impact on the fate of Michel's government.