Serbia's main pro-reform parties have agreed to form a government, keeping out the largest party in parliament, the hardline nationalist Radicals.
Vojislav Kostunica will stay on as prime minister
The coalition was agreed more than three months after the general election, and four days before a deadline for new polls expired.
Serbian President Boris Tadic said caretaker Prime Minister Vojislav Kostunica would stay on in the post.
Radical parliamentary speaker Tomislav Nikolic has said he will resign.
A parliamentary session will be held on Sunday to approve the new government.
The deal was reached after hours of negotiations between President Tadic, leader of the Democratic Party, and Mr Kostunica, from the Democratic Party of Serbia (DSS).
It has been reported that the ministries of defence and interior will be divided between these two parties.
Earlier this week, Mr Nikolic was elected parliamentary speaker, prompting fears that Serbia could abandon the road to reform.
Democratic Party of Serbia (DSS)
New Serbia party
The nationalist Radicals became the largest party in parliament in the January election. But no party has enough seats to govern alone.
Reports said President Tadic, whose party is the most pro-Western, would take charge of the national security council, responsible for the hunt for the fugitive Bosnian Serb wartime leaders Ratko Mladic and Radovan Karadzic.
The agreement involves the Democratic Party, the DSS, G-17 and New Serbia.
The BBC's Nick Hawton in Belgrade says the deal marks an end to the immediate political crisis facing Serbia.
But he says an even greater challenge lies ahead. The UN Security Council is currently discussing a plan to give Kosovo its independence, something demanded by its majority Albanian population.
Serbia strongly opposes the plan and has vowed never to accept it.