Updated

Marking the final departure of U.S. forces from Iraq after abandoning a security framework that called for an ongoing military presence there, President Obama said Monday the United States is prepared to help Iraq's national security -- not with troops but through training and trade.

Appearing in Washington with Prime Minister Nouri al-Maliki at his side, Obama said of the U.S. war to liberate the country and tamp down an al Qaeda insurgency: "Those days are over."

As of late last week, the number of U.S. troops in Iraq had dwindled to about 6,000, down from 170,000 at the war's peak in 2007. Troops are expected to be completely pulled out by year's end.

"This is an historic moment, a war is ending," Obama said.

Obama said the U.S. will now help Iraq train and equip its own forces and will establish a formal channel of communication between national security advisers.

Al-Maliki said the departure of the last American soldier does not end the relationship.

"It only started when it was signed in 2008, in addition to the withdrawal treaty, the strategic framework agreement for the relationship between our two countries," he said.

With U.S. forces no longer on the ground, the U.S. State Department now represents the most massive U.S. presence in Iraq.

Obama said the "comprehensive" relationship with Iraq will be based on science and commerce, electricity and power generation projects, joint military exercises and "a whole range of issues."

"We want to make sure there is a constant communication between our governments, that there are deep and rich exchanges between our two governments, and between our peoples," he said.

Already, the Obama administration has notified Congress of its intent to sell Iraq a second round of F-16s. The country will receive 18 new military planes, according to National Security spokesman Tommy Vietor.

"This sale is another indication of the continuing U.S.-Iraqi security relationship and cooperation. It also illustrates the progress Iraq has made in providing for its own security, and its determination to protect its sovereignty and independence," he said.

But not everyone is thrilled by the new era in U.S.-Iraqi relations. Releasing a statement after the executive-level meeting, Sen. John McCain, the ranking Republican on the Senate Armed Services Committee, said both Obama and Maliki have "failed in their responsibilities with regard to our shared security interests" because they could not reach agreement on a strategic framework that would allow U.S. military to establish bases in the country.

"Domestic political considerations in each country have been allowed to trump our common security interests," McCain said.

"All of the progress that both Iraqis and Americans have made, at such painful and substantial cost, has now been put at greater risk. I hope I am wrong, but I fear I am not. It did not have to be this way, and the fact that it is has everything to do with a failure of vision, commitment, and leadership both in Washington and Baghdad," he added.

From the beginning of the Iraq war, and while a U.S. senator, Obama has opposed the U.S. military operation, going so far as to call it a "dumb war." Asked Monday whether he still felt that way, Obama responded, "I think history will judge the original decision to go into Iraq.

"But what's absolutely clear is, as a consequence of the enormous sacrifices that have been made by American soldiers and civilians -- American troops and civilians, as well as the courage of the Iraqi people, that what we have now achieved is an Iraq that is self-governing, that is inclusive and that has enormous potential," he said.

One of the chief concerns regarding the U.S. pullout is not whether, but how much Iran will be able to influence both government and security operations in Iraq. Al-Maliki has insisted that Iraq will chart its future according to its own national interests, not Iran's dictates or any other country.

But both Iran and Iraq are dominated by Shiite political groups, which represent a majority of the population, and many Iraqi politicians spent time in exile in Iran under Saddam Hussein's repressive regime. One of al-Maliki's main allies -- anti-American cleric Muqtada al-Sadr -- is believed to spend most of his time in Iran.

Jon Alterman, director of the Middle East Program at the Center for Strategic and International Studies, said how Baghdad chooses to orient itself will significantly influence the future of Iraq's relationship with the U.S.

"A lot of this really comes down to, what kind of role is Iraq going to play in regional security?" Alterman said. "Is it going to be a place where bad people come and go, or is it going to play a role in calming down a region that needs some calming down?"

The first hints as to how Iraq will assert itself in the region may come from how it handles the troubles in Syria, where a bloody government crackdown on protesters has killed more than 4,000 people, according to the United Nations.

The Obama administration has called for Syrian President Bashar Assad to step down. But al-Maliki has warned of civil war if Assad falls, and Iraq abstained from Arab League votes suspending Syria's membership an imposing sanctions. Those positions align Iraq more closely with Iran, a key Syrian ally.

Al-Maliki said Monday that he doesn't have "the right to ask a president to abdicate," and that he does "not encourage a blockade because it exhausts the people and the government."

Obama said Monday that the U.S. and Iraq have "tactical differences on how to deal with Syria," but he has "no doubt these decisions are being made on what's best for Iraq, not based on what Iran would like to see."

Al-Maliki's "interest is maintaining Iraqi sovereignty and preventing meddling by anyone in Iraq, and I believe him."

The Associated Press contributed to this report.