Bickering between the two camps had left the presidency vacant since pro-Syrian Emile Lahoud's term ended in November. Nineteen previous attempts to get lawmakers together to elect a successor failed.
On Wednesday, the rivals finally agreed to elect Sleiman, form a national unity government in which the opposition has veto power and draft a new electoral law for a parliamentary election due next year.
The accord came after 65 people were killed in street battles this month between Hezbollah and their allies and pro-government forces.
It was the deadliest sectarian violence since the 1975-1990 civil war and which threatened to spiral into all-out conflict after Hezbollah, the most powerful armed group in Lebanon, seized control of mainly Sunni west Beirut.
Sleiman said he would seek friendly relations with Syria, Lebanon's former powerbroker which has been accused by Washington of stoking the crisis.
As president -- a position reserved for a Maronite Christian under Lebanon's multi-confessional system -- Sleiman will have to tread a fine line to keep the neutrality he maintained during 10 years as army chief.
He is the third army leader to become president after Fouad Chehab in 1958-1964 and Lahoud, who was elected in 1998 but whose term was controversially extended by three years under a Syrian-inspired constitutional amendment in 2004.
Bush said he looked forward to "an era of political reconciliation".
"I am confident that Lebanon has chosen a leader committed to protecting its sovereignty, extending the government's authority over all of Lebanon, and upholding Lebanon's international obligations under UN Security Council resolutions."
UN chief Ban Ki-moon expressed hope the vote will lead to the "revitalisation of all of Lebanon's constitutional institutions and a return to political dialogue."