Bosnian main Muslim, Croatian, and Serbian parties have agreed to form a central government, ending a political impasse since an inconclusive October 2010 election.
The leaders announced the deal at a press conference in Sarajevo.
Bosnian Serb leader Milorad Dodik was quoted as praising the agreement as a victory for "compromise and understanding" after months of disagreement.
Dragan Covic of the largest ethnic Croat party, the Croatian Democratic Union, also hailed the agreement.
"Determination and courage was needed for these talks, but this compromise gives us the chance that all the processes in the structures of the whole of Bosnia-Herzegovina will start moving forward," Covic said.
Sulejman Tihic, head of the Party of Democratic Action (SDA), the largest Bosnian Muslim party, said that while none of the parties were "completely satisfied" with the deal, it was still "a good agreement in the interest of Bosnia-Herzegovina and all its nations and citizens."
The agreement passes a budget for state institutions to avoid financial problems. Reports say the deal will enable the release of funds from the European Union and the International Monetary Fund.
Leaders of the six largest political parties said they had also agreed on a long-delayed set of laws that pave the way for Bosnia to apply for EU membership.
The agreement ends a political crisis that had effectively paralyzed the country for more than a year and blocked further EU integration, as well as Bosnia's hopes of entering NATO.
with agency reports