Former Cuban president Fidel Castro says American society is marked by "profound racism" and it is a "pure miracle" that US presidential hopeful Barack Obama has not been assassinated.

"Profound racism exists in the United States," Mr Castro wrote in a commentary that appeared on the website Cubadebate as he weighed in on the US presidential race ahead of the November 4 election.

"Millions of whites cannot reconcile in their minds with the idea that a black man with his wife and children would move into the White House, which is called just like that, White," he wrote.

He added that it was a "pure miracle" the Illinois senator, who became the first black politician to win the Democratic Party's presidential nomination, had not been assassinated thus far.

The ailing Cuban communist leader, who handed power to his brother Raul earlier this year, described Senator Obama as a politician who "has the habit of looking at his opponent with serenity and laughing at his rhetorical attacks."

Mr Castro's comments came as a war of words with racial undertones marked the US White House race after civil rights icon John Lewis accused Republican candidate John McCain of sowing "hatred" against Senator Obama, who is developing a commanding lead in opinion polls.

Mr Castro also mocked Senator McCain's poor grades at the naval academy and said Republican vice presidential nominee Sarah Palin "knew nothing at all about anything."

-AFP