Hariri, the son of slain former Lebanese Prime Minister Rafik Hariri, and who has close ties to Saudi Arabia, backed Aoun's nomination in a move that could be seen as a political win for Iranian-backed Hezbollah and its allies.
Mr Hariri - who has in the past accused Mr Aoun of being in league with Syrian elements accused of assassinating his father Rafic Hariri in 2005 - said he chose to support his former rival as all other options had been exhausted, adding that Lebanon needs protecting from the Syrian crisis next door.
A worker hangs a billboard showing Christian leader Michel Aoun with Arabic that reads "For all Lebanon", in the southern port city of Sidon, Lebanon, Sunday, Oct. 30, 2016.
Lebanon's parliament has begun procedings to elect a new president and end more than two years of political vacuum.
The next challenge will be forming a government, which is expected to take months of wrangling.
State Department spokesman John Kirby congratulated the people of Lebanon, describing Aoun's election as a "moment of opportunity" to restore government institutions as Lebanon emerges from years of political impasse.
Aoun's move to Hezbollah drew anger from the United States which believed he had given political cover for it to keep its weapons and "moved a long way" from his support for a U.N. resolution that sought the disarmament of all militias in Lebanon, according to a USA diplomatic cable published by Wikileaks.
Aoun refused to sign the 1989 Taif agreement which brought the civil war to an end, arguing it cemented Syria's military presence and reduced the power of the presidency, the key governmental post reserved for Lebanon's Christians. He was then forced out of the presidential palace and into exile in France in 1990. In Beirut's majority-Christian neighbourhood of Ashrafiyeh, supporters launched fireworks and loosed volleys of celebratory gunfire even as he took the oath of office before lawmakers, AFP reported.
The atmosphere in Jdeideh outside Beirut was one of untrammelled joy, with thousands honking vehicle horns and popping bottles of champagne.
"I'm so happy. After 25 years our dream has come true", said 33-year-old accountant Giselle Tammam, celebrating in Jdeideh outside Beirut.
"We're counting the minutes until General Aoun is elected, we've waited a long time", said Jean, a 35-year-old hairdresser in the Dekwaneh neighborhood outside Beirut.
In his victory speech Aoun vowed to fight terrorism "preemptively" and stop regional conflicts engulfing Lebanon.
"We must also address the Syrian refugee crisis through securing a quick return" for them to their country, Aoun added, stressing that "refugee encampments and gatherings must not turn into security ghettos".
Aoun, a strong ally of Hezbollah, secured 83 votes out of 127 after several rounds of voting.
The final tally included 36 blank votes and eight void ballots.