The agreement came after five days of tense talks in Doha
Rival Lebanese leaders have agreed on steps to end the political deadlock that has led to the country's worst violence since the 1975-90 civil war.
The Western-backed government and the pro-Syrian opposition arrived at the deal after days of talks in Qatar.
Under the deal, the opposition - led by the Hezbollah political and militant group - will have the power of veto in a new cabinet of national unity.
It also paves the way for parliament to elect a new president.
The post has been empty since November.
Correspondents say the agreement is a major triumph for Hezbollah, whose key demands have been met.
In a speech at the ceremony in the Qatari capital Doha in which the deal was signed, Prime Minister Fouad Siniora said it was "an exceptional agreement at an exceptional time".
Telecommunications Minister Marwan Hamadeh said there were "no losers" under the deal.
Western-backed ruling majority to get 16 cabinet seats and choose prime minister
Syrian-backed opposition to get 11 cabinet seats and veto power
Three cabinet seats to be nominated by president
The use of weapons in internal conflicts is to be banned
Opposition protest camps in central Beirut are to be removed
New law to divide country into smaller electoral districts
Amr Moussa, head of the Arab League, which brokered the agreement, said it "releases Lebanon from its shackles".
Saad Hariri, a Sunni politician who leads the governing coalition, said the agreement opened "a new page for Lebanon".
Hezbollah delegation leader Mohammed Raad said it would help "towards strengthening coexistence and building the state".
The agreement gives the Hezbollah-led opposition bloc enough seats in the cabinet for a veto.
The controversial issue of Hezbollah's arsenal is addressed. The deal states that "use of arms or violence is forbidden to settle political differences".
HAVE YOUR SAY
A great agreement achieved for Lebanon; hopefully the beginning of new era
Hezbollah, which is backed by Syria and Iran, has been refusing to give up any of its military capability, arguing that it is essential in the struggle against Israel.
Syrian Foreign Minister Walid Moualem told Reuters news agency that Damascus was "pleased that our brothers in Lebanon have reached an agreement".
The US also hailed the accord. David Welch, who is in charge of Middle Eastern affairs at the state department, called it "really a welcome development".
The agreement paves the way for parliament to elect army chief General Michel Suleiman as president, which officials say will happen on Sunday.
For months, Gen Suleiman has been accepted by all sides as the only candidate to succeed outgoing pro-Syrian President Emile Lahoud, but disagreements have repeatedly prevented a parliamentary vote to appoint him.
Dozens of people died in clashes earlier this month
An opposition protest camp in central Beirut is also to be dismantled, in what Parliament Speaker Nabih Berri called a "gift" from the opposition.
Hezbollah members have already started to carry away mattresses from the encampment.
BBC diplomatic correspondent Jonathan Marcus says the Doha deal appears to have averted calamity by acknowledging a greater political role for Hezbollah.
He adds that some in the West, while applauding Lebanon's step back from the brink, may see this as a negative development.
Lebanon has been in political crisis since late 2006 when the opposition left a national unity coalition cabinet, demanding more power and a veto over government decisions.
The crisis turned violent two weeks ago when street battles between armed supporters of the factions left at least 65 people dead.
The clashes were triggered by government attempts to outlaw Hezbollah's private telephone network and reassign Beirut airport's security chief, who is close to the opposition.