BRUSSELS — The financial markets have finally done what 18 months of talks, a large protest march and a series of bizarre demonstrations failed to do: broken Belgium’s political deadlock.

After an indecisive election in June 2010, the country’s fractious political parties could not manage to form a governing coalition until this week, when a credit downgrade and the threat of being engulfed in the euro debt crisis brought new urgency.

Six parties with enough combined Parliament seats to govern reached a coalition agreement late Wednesday and presented it to King Albert II on Thursday. Barring any new problems, Elio Di Rupo will be sworn in as prime minister on Monday.

A leader of the country’s Socialists, Mr. Di Rupo, 60, will be the country’s first head of government since the 1970s whose first language is French, a subject of controversy in a country divided between 4.5 million French speakers, who live mainly in Wallonia in the south, and 6.5 million Dutch speakers, who live mainly in Flanders, the wealthier northern region, where separatist parties have gained ground.