US President Barack Obama
[Representational Image] The president added that manipulating citizens to doubt the legitimacy of the US presidential elections would benefit the country's enemies.Reuters

United States President Barack Obama has said that Republican presidential candidate Donald Trump's comment that he would accept the results of the election if he wins, is "dangerous" and is an insult to the American democracy.

"You're doing the work of our adversaries for them, because our democracy depends on people knowing that their vote matters," President Obama said while speaking at a campaign rally in Miami for Democratic presidential candidate Hillary Clinton.

The president added that manipulating citizens to doubt the legitimacy of the US presidential elections would benefit the country's enemies, BBC reported.

Trump had declined to say that he would accept the results of the presidential elections during the third and final presidential debate between the two candidates. He had said that he would like to keep it as "suspense."

"I would like to promise and pledge to all of my voters and supporters and to all of the people of the United States, that I will totally accept the results of this great and historic presidential election - if I win," Trump said in Ohio on Thursday.

First Lady Michelle Obama also attacked Trump for his comments and said that "you do not keep American democracy in suspense."

Trump added that he would accept a clear election result, but reserved the right to file a legal challenge if it was rigged, BBC reported. Trump was later criticised by members of his own party for suggesting that he might not accept the outcome of the results.

Kellyanne Conway, Trump's campaign manager, later said that the Republican nominee just meant he wouldn't accept defeat until the "results are actually known".

"A concession isn't just an exercise in graciousness. It is an act of respect for the will of the American people, a respect that is every American leader's first responsibility," Republican Senator John McCain said.