By Nick Hawton
BBC News, Belgrade
Serbia's presidential election is over, the dust has settled but the real questions are only now just beginning.
Mr Tadic will now be severely tested on the Kosovo issue
What does this election mean for Serbia in the coming years? What happens with the breakaway province of Kosovo? And what about Serbia's ambitions to join the European Union?
The pollsters had predicted a tight race and that was exactly what it turned out to be with the pro-Western, pro-reform Boris Tadic only just scraping home for victory.
Mr Tadic may have won, and he may be seen as the leader of Serbia's democratic block, but very nearly 50% of the voters cast their ballot for Tomislav Nikolic - a hardline nationalist whose party leader is facing war crimes charges at the UN war crimes tribunal in The Hague.
The democrats scored a narrow victory, but their position remains fragile.
The election showed that Serbia is a very divided country - years after the fall of the late President Slobodan Milosevic.
And now this fragility will be severely tested with the issue of Kosovo.
It is widely expected that Kosovo's majority ethnic Albanian population will declare independence from Serbia in the next few weeks.
But what will Serbia now do?
The government in Belgrade has drawn up an "action plan" it will take should Kosovo declare independence.
The details have been kept secret but it is understood to contain various diplomatic, economic and political measures. Ministers have ruled out military action.
Diplomatic sources say the scale of Serbia's reaction will depend on what happens on the ground.
If there is a relatively benign environment, Serbia's actions are likely to be less vigorous. But if columns of Serb refugees start leaving the province, then Belgrade will come under strong public pressure to react more severely.
'Friend in Belgrade'
Among the options would be sealing the border with Kosovo, imposing economic sanctions and breaking diplomatic relations with countries that recognise Kosovo's independence.
But how long such measures would be enforced is a moot point. If Serbia wants to join the EU, taking measures against EU countries would certainly not help its case.
And this is one of the key reasons why Western capitals breathed a collective sigh of relief when it became apparent that Mr Tadic had won the presidential election.
Whilst vehemently opposing Kosovo's independence, Mr Tadic has also made it an absolute priority for Serbia to join the EU.
Brussels would rather have a would-be friend in the presidential palace in Belgrade, than a hardline nationalist with strong doubts about any ties with the EU.
But the issue gets more complicated because of the internal political situation in Belgrade.
Mr Kostunica refused to back Mr Tadic before the poll
Mr Tadic's Democratic Party is a coalition partner in the government of Prime Minister Vojislav Kostunica.
The relationship between president and prime minister has come under severe strain recently.
The increasing rift between the two was highlighted when Mr Kostunica even refused to endorse Mr Tadic in the election. And then there is the issue of Serbia and the EU.
Mr Kostunica has made it clear that he strongly opposes the new EU mission which is likely to be deployed to Kosovo in the next few months, suggesting Serbia should not join the EU if most countries in the EU recognise an independent Kosovo.
Mr Kostunica's feelings towards the EU are distinctly lukewarm compared to Mr Tadic.
Already rumours are circulating around Belgrade that the coalition government may be under threat and new parliamentary elections could be called.
The presidential election is over and the Serbian people have narrowly chosen a path which leads towards the EU. But political instability remains a threat and Kosovo remains a very difficult issue still to be resolved.