Mr Spielberg formally announced his decision in a statement
In a statement, he accused China of not doing enough to pressure Sudan to end the "continuing human suffering" in the troubled western Darfur region.
At least 200,000 people have been killed and two million forced from their homes in the five-year conflict.
Beijing has not yet responded to the move, which correspondents say is its first big setback in staging the Games.
This is a noble move by Spielberg - he will certainly go down in history as someone who gave human lives precedence over fame and money
Abdul Wahid Mohammad Ahmed al-Nur
Sudanese rebel leader
China's dilemma over Darfur
A source in the Beijing Olympic Committee said a response was being discussed at the highest levels but had not yet been made public.
But the BBC's James Reynolds in Beijing says the decision will anger and worry the authorities there.
Since Beijing won the right to host the Games it has always tried to keep China's politics and China's Olympics separate, he says, and it has attacked anyone who has tried to link the two.
Boycott call
Mr Spielberg, who had been brought in as artistic adviser for the opening and closing ceremonies of the Games, said the cause of Darfur was more important than his role.
"I find that my conscience will not allow me to continue business as usual," he said in a statement.
"At this point, my time and energy must be spent not on Olympic ceremonies, but on doing all I can to help bring an end to the unspeakable crimes against humanity that continue to be committed in Darfur."
OLYMPICS ROW Famous names involved in advising the Olympics include director Zhang Yimou and Kung Fu star Jackie Chan Hollywood stars Mia Farrow and George Clooney have criticised China over Darfur Architect Ai Weiwei, who designed the main Olympic stadium, says the Games are a "public relations sham"
Athletes put focus on Darfur
He added: "Sudan's government bears the bulk of the responsibility for these on-going crimes, but the international community, and particularly China, should be doing more."
Rebel groups in Darfur said this was exactly the kind of pressure that was needed to get Beijing to change its policy towards the Sudanese government.
"This is a noble move by Spielberg," Sudan Liberation Movement (SLM) leader Abdul Wahid Mohammad Ahmed al-Nur told the Sudan Tribune newspaper.
"He will certainly go down in history as someone who gave human lives precedence over fame and money."
Ahmed Abdel Shafi, who leads an SLM splinter group, told the BBC: "I commend him for his strong position. This is a lesson to the rest of the world that people should distance themselves from China."
HAVE YOUR SAY The real question is why the Olympics were awarded to China in the first place Vladi, California
The International Olympic Committee said the decision was a personal one made by Mr Spielberg.
"The IOC recognise Darfur is a highly complex issue, with tragic circumstances, but is a matter for the UN to resolve," the committee said in a statement.
'Desperate time'
Sudan, with its vast oil reserves, sells some two-thirds of its oil to Beijing.
In turn, Beijing sells weapons to the Sudanese government and has defended Khartoum in the UN Security Council.
As a result, China has been criticised for its links with a government ostracised by many for its role in the ongoing crisis in Darfur.
Earlier on Tuesday, as part of a "Global Day of Action" focusing on Darfur, an open letter signed by Nobel Peace Prize laureates and former Olympians was sent to China's president.
Actress Mia Farrow, who signed the letter and had pressed Mr Spielberg to end his involvement, said his decision sent out the right signal to the Chinese government.
She said: "I'm delighted by his decision and it's a desperate time for Darfur, so this is a shred of good news in a very bleak week."
Steven Spielberg in 1999.
Beijing National Stadium, where the opening ceremonies will take place.
On Wednesday, United States film director Steven Spielberg withdrew from his position as artistic adviser to the 2008 Summer Olympics in Beijing, China. "Conscience will not allow me to continue with business as usual," he said.

"Sudan's government bears the bulk of the responsibility for these ongoing crimes but the international community, and particularly China, should be doing more to end the continuing human suffering there," Spielberg's statement said. "China's economic, military and diplomatic ties to the government of Sudan continue to provide it with the opportunity and obligation to press for change."

China immediately expressed regret over his decision and suggested that "ulterior motives" may be at play. "It is understandable if some people do not understand the Chinese government policy on Darfur, but I am afraid that some people may have ulterior motives, and this we cannot accept. ... China is also concerned about the humanitarian situation in Darfur. But empty rhetoric will not help. We hope that relevant people will be more pragmatic," said Liu Jianchao, the Deputy-Director General of the Information Department in China's foreign ministry.

Following Spielberg's withdrawal, other organizations called for boycott of the Games. However, United Kingdom Minister for the Olympics Tessa Jowell rejected such calls. "The world has known for the last seven years that Beijing would host the Olympics," Jowell told ''The Times''. "Most progressive governments accept that there are wholly unacceptable aspects of Chinese policy, but that did not stop the International Olympic Committee awarding them the games. A call for a boycott doesn't serve any purpose and it would be a great pity. This doesn't mean, however, we should be distracted from the urgency of Darfur."

"China is also concerned about the humanitarian issues there, but we have been playing a positive and constructive role in promoting peace in Darfur," Liu said, adding that China is working with the United Nations to provide aid and resolve the crisis.

Critics of China contend that China supports the Islamic regime in Sudan because it buys two-thirds of the country's oil exports and also sells it weapons. Further, China has been defending the government in Khartoum in the United Nations Security Council. Since 2003, fighting between government-backed militia and rebels in Darfur has led to the death of more than 200,000 people and displaced some 2.5 million others.

Meanwhile, United States President George W. Bush confirmed that he still plans to attend the Games in Beijing. "I view the Olympics as a sporting event. On the other hand, I have a different platform to Steven Spielberg, so I get to talk to Hu Jintao President of China and I do remind him he can do more to relieve the suffering in Darfur."

Bush followed this by saying: "I’m not going to use the Olympics as an opportunity to express my opinions to the Chinese people in a public way because I do it all the time with the president."