The president spoke after a videoconference with Iraqi Prime Minister Nouri al-Maliki. The White House says the two men agreed this is the best way forward for both countries.
The president's announcement fulfills a campaign promise he made more than four years ago.
The U.S. has already withdrawn more than 100,000 troops from Iraq. And Obama says the last 40,000 will be leaving by the end of this year.
"Across America, our servicemen and women will be reunited with their families," he said. "Today I can say that our troops in Iraq will definitely be home for the holidays."
The timetable was negotiated back in 2008 by former President Bush. The U.S. and Iraq had been negotiating about keeping several thousand troops in the country beyond the end of the year. But they were unable to reach agreement on the issue of legal immunity for such forces.
Deputy National Security Adviser Denis McDonough says the U.S. will continue to provide military trainers to Iraq as it does to other countries. But he says the president envisions a more normal relationship with Iraq, built on trade and diplomacy.
"He said what we're looking for is an Iraq that's secure, stable and self-reliant," McDonough says. "And that's exactly what we've got here. So there's no question this is a success."
Withdrawals Also Planned In Afghanistan
Obama is also planning a troop drawdown in Afghanistan, and says by year's end there will be half as many Americans in the two war zones as there were when he took office.
Obama is increasingly relying on more targeted military operations, like the raid that killed Osama bin Laden, or the NATO campaign that toppled Libyan leader Moammar Gadhafi.
"The end of war in Iraq reflects a larger transition," he said. "The tide of war is receding."
So far, Obama has drawn little political advantage from his foreign policy successes. His approval rating jumped briefly after bin Laden was killed, but slumped again over the summer. Aides say that's understandable, given that the country is preoccupied with domestic economic problems. Obama acknowledged as much in his announcement Friday.
"After a decade of war, the nation that we need to build and the nation we will build is our own — an America that sees its economic strength restored, just as we've restored our leadership around the globe," he said.
Iraq Welcomes Announcement
The president's announcement was welcomed in Iraq. In Baghdad, a spokesman for Prime Minister Maliki called it a victory for both sides.
Right up to the end, most Iraqi officials privately said they wanted to keep some American troops here, particularly in the north where tensions between Arabs and Kurds still run high. In addition, American forces could help guard against a new round of violence between Shiites and Sunnis.
But it was a different story in public. The Americans said that for U.S. troops to remain into next year, they would need to have immunity from prosecution in Iraqi courts. But that would require a new agreement in Iraq's parliament.
This touched a nerve with many Iraqis, especially with America's main enemy, Muqtada al-Sadr, the cleric backed by Iran.
His militia, the Mahdi Army, fiercely battled American troops during the war. Offshoots of that group and other Iranian-backed groups still launch attacks on American bases.
Now Sadr's party holds dozens of seats in parliament, and public opinion appeared to be running in Sadr's favor on the question of immunity for American troops.
Samira Jihad Ahmed's brother-in-law was driving down an alley one day in 2004 when he was shot in the forehead and killed by an American soldier.
"We appreciate that the Americans got rid of Saddam and tried to bring us peace," she says. "But it's also a question of dignity. We can't let them keep on hurting innocent people."
U.S. base closings and handover ceremonies have become the norm. About 500 soldiers leave each day.
At a recent ceremony, one American general directed his thoughts to his Iraqi counterparts. We have given you the gift of democracy and the chance to determine your own future, he said. That gift has come at a great cost.