Col Gaddafi was conciliatory up until his comments about candidate Obama
Libya's leader has strongly criticised US presidential candidate Barack Obama for saying Jerusalem should remain the undivided capital of Israel.
Col Muammar Gaddafi said he was either ignorant of the Middle East conflict or lying to boost his campaign.
Mr Obama was speaking to pro-Israel lobbyists in the US last week.
Referring to him as "our Kenyan brother", Col Gaddafi also said Mr Obama might suffer from an inferiority complex because of his African origins.
The issue of race could make Mr Obama's behaviour "more white than white people", Col Gaddafi suggested, rather than acting in solidarity with African and Arab nations.
The comments came during a speech to mark the 38th anniversary since the US evacuated Wheelus Air Force base in Tripoli.
Israel claims Jerusalem as its "eternal, undivided" capital, but the Palestinians want the eastern half - occupied by Israel in 1967 - as the capital of a future Palestinian state.
The Americans left Libya shortly after Col Gaddafi came into power in a bloodless coup in 1969.
The BBC's Rana Jawad in Tripoli says the speech was a passionate critique of past US policies towards Libya but emphasised that current relations are not confrontational.
However, Col Gaddafi's defiant and famously politically incorrect rhetoric returned when talking about Mr Obama towards the end of the speech.
"The statements of our Kenyan brother of American nationality Obama on Jerusalem... show that he either ignores international politics and did not study the Middle East conflict or that it is a campaign lie," he said.
"We fear that Obama will feel that, because he is black with an inferiority complex, this will make him behave worse than the whites."
"This will be a tragedy," Gaddafi said. "We tell him to be proud of himself as a black and feel that all Africa is behind him."
Mr Obama's epic primary campaign against Democratic rival Hillary Clinton ended in his victory early this month.
The presidential election will be in November.
Correspondents say he has largely avoided playing on past racial struggles in the US and has drawn support among black and white Americans.
In addition, Mr Gaddafi suggested Mr Obama's comments may have been informed by a fear of assassination by Israeli agents, "the same fate as [former US President John F] Kennedy when he promised to look into Israel's nuclear programme".
Conspiracy theories abound about Kennedy's assassination in 1963. An inquiry led by the chief justice of the US Supreme Court found that the shooting was carried out by a lone gunman, Lee Harvey Oswald.