Flying unannounced into a still-dangerous war zone, President Barack Obama told US troops and Iraqi officials alike Tuesday it is time to phase out America's combat role in a conflict he opposed as a candidate and has vowed to end as commander in chief. Iraqis “need to take responsibility for their own country,” Obama told hundreds of cheering soldiers gathered in an ornate, marble palace near Saddam Hussein's former seat of power. “You have given Iraq the opportunity to stand on its own as a democratic country. That is an extraordinary achievement,” he told the troops, saluting their efforts during six years of American fighting and losses. Just hours before he arrived, a deadly car bomb exploded in Baghdad, underscoring the continuing peril despite a recent decline in violence. But the mood was festive as Obama spoke to some 600 troops, quickly gathered for his visit. “We love you,” someone yelled from the crowd of photo-snapping men and women in uniform. “I love you back,” responded the president, repeating a sequence that played out at hundreds of campaign stops on his successful run for the White House last year. Obama met with top US commanders as well as senior Iraqi leaders on a visit of a little more than four hours that was confined to Camp Victory, the largest US military base in a war that began in 2003 and has cost the lives of 4,265 members of the US military. Many thousands more Iraqis have perished. A helicopter flight to the heavily fortified Green Zone a few miles distant was scrapped, but White House aides attributed the change in travel plans to poor weather rather than security concerns. After a session with Prime Minister Nouri Al-Maliki, Obama said he had “strongly encouraged” Iraqis to take political steps that would unite political factions, including integrating minority Sunnis into the government and security forces. Al-Maliki told reporters, “We assured the president that all the progress that has been made in the security area will continue.” American commanders told the president the country is experiencing a relatively low level of violence, although the car bomb explosion in a Shiite neighborhood of Baghdad was evidence of a recent resurgence. Obama flew from Turkey, the next-to-last stop on an eight-day itinerary that also included Britain, France, Germany and the Czech Republic. Aides said Obama chose to visit Iraq rather than Afghanistan, where US troops are also in combat, in part because it was close to Turkey and in part because of upcoming Iraqi elections.