A pressure test showed a cement plug put in place by BP to permanently "kill" the well was holding.
President Obama hailed the news, vowing to continue to help those affected.
The worst offshore oil spill in US history began after the Deepwater Horizon rig blew up on 20 April, killing 11 workers and later sinking.
The top US federal official overseeing the disaster, Coast Guard Adm Thad Allen, said on Sunday that the well was now "effectively dead".
"Additional regulatory steps will be undertaken but we can now state definitively that the Macondo Well poses no continuing threat to the Gulf of Mexico," Adm Allen said.
A temporary cap had sealed the flow on 15 July while a relief well was dug. That well finally linked up with the ruptured well on Thursday, allowing workers to start pumping in the cement, removing the need for the cap and creating the permanent "kill".
The disaster has brought an environmental nightmare to hundreds of miles of US coast. It led to BP chief executive Tony Hayward standing down and the imposition of a moratorium on deepwater offshore drilling.
In a statement, President Obama hailed Sunday's "important milestone" and thanked all those who had "worked around the clock to respond to this crisis and ultimately complete this challenging but critical step to ensure that the well has stopped leaking forever".
He said he remained "committed to doing everything possible to make sure the Gulf Coast recovers fully from this disaster".
He added: "This road will not be easy, but we will continue to work closely with the people of the Gulf to rebuild their livelihoods and restore the environment that supports them."
The cost of the disaster to BP has been massive. It has created a compensation fund of $20bn and paid out another $8bn so far in the clean-up campaign.
This final sealing will mean BP can leave the site and concentrate on dealing with the aftermath of the spill.
At the beginning of August, the US government announced that almost three-quarters of the oil had been cleaned up or broken down by natural forces.
The remaining quarter was thought to be "degrading quickly".
But more recent research noted an undersea plume of crude oil-based chemicals up to 200m high and 2km wide, extending 35km from the spill site.
Despite optimism about the clean-up, the damage to the local economy, wildlife and the ecosystem of the Gulf is hard to fully assess yet.
Source: BBC News