The outspoken film-maker Michael Moore endorsed Barack Obama for the Democratic nomination on the eve of the Pennsylvania primary tomorrow, accusing Hillary Clinton of cynically trying to inject race into the contest.

In an angry posting on his website, Moore said he had intended to stay neutral in the Democratic contest but was led to speak out after last week's debate in Philadelphia when Obama was questioned about his pastor, the Reverend Jeremiah Wright.

Moore, who became famous for his cinematic rants against the gun industry, the Bush administration, and the US health care system, said he was disgusted when Clinton followed up on the moderators' line of questioning to Obama by mentioning Wright's contacts with the Nation of Islam leader, Louis Farrakhan.

The remarks, said Moore, were the final straw.

"I've watched Senator Clinton and her husband play this game of appealing to the worst side of white people, but last Wednesday, when she hurled the name "Farrakhan" out of nowhere, well that's when the silly season came to an early end for me. She said the "F" word to scare white people, pure and simple."

He goes on to even stronger language against Clinton. "Yes, Senator Clinton, that's how you sounded. Like you were nuts. Like you were a bigot stoking the fires of stupidity."

The endorsement for Obama marks a turnaround for Moore who has been critical of the Democratic frontrunner on his website -- even while lauding the historic nature of his candidacy.

Moore has criticised Obama for taking money from the health industry. Meanwhile, Obama's economic adviser, Austan Goolsbee, has taken issue with Moore's prescriptions for fixing the US health care system.

It's unclear how much weight Moore's endorsement will carry in Pennsylvania.

Moore lives in Michigan, whose unsanctioned primary will not count towards the Democratic nomination. He is also viewed with suspicion by some Democrats for supporting the third party candidacy of Ralph Nader in 2000, which helped cost Al Gore the presidency.

Moore is also somewhat grudging in bestowing his approval on Obama -- or any Democratic candidate. "My endorsement is more for Obama The Movement than it is for Obama the candidate," he writes.

He goes on to take a swipe at the Democrats as a "nicer version" of a party that exists to do the bidding of corporate America.