Boris Tadic received 53.5% of the vote, while Tomislav Nikolic got 45.1%, according to independent monitors from Belgrade's CeSID group. Turnout was 48.5%.
The presidential vote was crucial to whether Serbia moves closer to the European Union and NATO or sinks back into the nationalist isolation reminiscent of Mr Milosevic's autocratic regime.
Three previous attempts to elect a president since 2002 failed because too few voters showed up at the polls. This vote was certain to produce a president regardless of the turnout, after Parliament earlier this year scrapped a 50% turnout requirement.
"It is certain that Boris Tadic has won and is the new president of Serbia," said Zoran Lucic, a spokesman of the CeSID group.
After casting his ballot in Belgrade earlier in the day, Mr Nikolic predicted a tight race but said his "victory would return pride and dignity to Serbia."
Mr Tadic, who also voted in Belgrade, declined to predict a winner but said he was not worried about the result.
"This day is very important in Serbia's political history," Mr Tadic said. "I am convinced Serbia will show it is going toward a better life for all its citizens."
Mr Tadic, 46, a soft-spoken Sarajevo-born psychologist and Belgrade college professor, entered politics in 1990 as a member of the pro-Western Democratic Party.
After the March 2003 assassination of Zoran Djindjic the Democrats' leader and Serbia's first noncommunist prime minister since World War II Mr Tadic was catapulted to the forefront, taking the party helm in February 2004.
Mr Tadic has been an ardent supporter of extraditing Serb war crimes suspects to the UN war tribunal in The Hague, Netherlands, where Mr Milosevic and others are standing trial for their roles in the Balkan wars in the 1990s.