WASHINGTON (AP) — President Barack Obama heralded the end of the divisive Iraq war Monday, and warned Iraq's neighbors that the United States would remain a major player in the region even as it brings its troops home.

"Our strong presence in the Middle East endures," Obama said. "And the United States will never waiver in the defense of our allies, our partners and our interests."

Speaking after a morning of meetings with Iraqi Prime Minister Nouri al-Maliki, Obama said other nations must not interfere with Iraq's sovereignty. While he stopped short of mentioning any countries by name, U.S. officials are closely watching how neighboring Iran may seek to influence Baghdad after U.S. troops withdraw.

Monday's meetings came as the last American troops were preparing to leave Iraq ahead of a Dec. 31 deadline. Just 6,000 U.S. forces remain, down from a high of 170,000 at the war's peak in 2007.

"Our war in Iraq ends this month," Obama said, with al-Maliki by his side.