Speaking after his win on Sunday evening, Social Democrat Marcelo Rebelo de Sousa vowed to "heal the wounds" left since Portugal's last parliamentary election in October.
The narrow result allowed the left to oust a center-right administration that had imposed tough austerity rules under international bailout rules established in 2011.
According to updated results late Sunday, based on 98 percent of constituencies, Rebelo de Sousa had cleared the 50-percent threshold to avoid a runoff by winning 52.4 percent of the votes.
Doubt had been cast by an earlier exit poll from public broadcaster Radiotelevisao Portuguesa which suggested he had fallen short of that threshold.
Following the news of the result, Rebelo de Sousa's opponents have both conceded defeat. Independent leftist Antonio Sampaio da Novoa finished with 22 percent of the vote, while Left Bloc candidate Marisa Matias took 10 percent.
Voter turnout was put at a low 52 percent after two weeks of campaigning.
Influential role in crises
Rebelo de Sousa looks set to become Portugal's mostly ceremonial head of state on March 9, replacing Aníbal Cavaco Silva, who has served the maximum of two five-year terms.
In a crisis, Portugal's president can dissolve parliament, giving the new president make-or-break powers over the nation's shaky Socialist-minority government.
The minority government runs Portugal with the backing of the Communist Party and the radical Left Bloc, and has tried to end austerity measures while exercising financial prudence.
Many political analysts, however, do not expect the Socialist-led government to serve a full four-year term.
Outgoing President Cavaco Silva swore in the Socialists late last year, saying he did so only because he was barred by the constitution from calling a new parliamentary election in his last six months in office.
That option will again become possible from April 4, six months after the last parliamentary election.
On Sunday, Prime Minister Antonio Costa vowed his "full cooperation" with the new president.
Under EU scrutiny
Brussels has watched closely to see whether Lisbon will abide by stringent economic measures that unlocked the 78-billion-euro ($85-billion) bailout in 2011.
Rebelo de Sousa previously served as a newspaper editor, a popular media pundit, has been a junior member of government since the 1970s, and is a former member of the European Parliament.
ksb,ipj/cmk (AFP, dpa)