The challenge to the U.S. initiative came as Nouri al-Maliki began a regional tour to shore up support from mostly Sunni Arab nations for his Shiite-dominated government as sectarian violence persists despite a nearly 10-week-old security crackdown.
The U.S. military announced last week that it was building a five kilometer (three mile) long and 3.6 meter (12 foot) tall concrete wall in Azamiyah, a Sunni stronghold in northern Baghdad whose residents have often been the victims of retaliatory mortar attacks by Shiite militants following bombings usually blamed on insurgents.
U.S. and Iraqi officials defended plans for the barrier as an effort to protect the neighborhood, but residents and Sunni leaders complained it was a form of discrimination that would isolate the community and a large protest was scheduled for Monday in the area.
In his first public comments on the issue, al-Maliki said Sunday that he had ordered the construction to stop.
"I oppose the building of the wall and its construction will stop," al-Maliki said during a joint news conference with the Secretary-General of the Arab League Amr Moussa in Cairo. "There are other methods to protect neighborhoods."
He did not elaborate but added "this wall reminds us of other walls," in an apparent reference to the wall that divided Berlin during the Cold War and Israel's construction of a barrier in the West Bank to keep out suicide bombers.
U.S. military spokesman Lt. Col. Christopher Garver declined to comment on whether construction of the wall would stop, saying only that all security measures were constantly under discussion.
"We will coordinate with the Iraqi government and Iraqi commanders in order to establish effective, appropriate security measures," he said.
It was not the first time al-Maliki has flexed his political muscle in a bid to force the Americans to back down.
In October, U.S. forces pulled down roadblocks around Baghdad's eastern slum of Sadr City hours after al-Maliki gave the order. The Shiite prime minister was said to have feared an explosion of violence among members of the Mahdi Army that is headquartered in Sadr City and was loyal to anti-American cleric Muqtada al-Sadr.
It was not immediately clear if the announcement by al-Maliki in Cairo was part of an effort to win Arab Sunni support.
Aides to al-Sadr, who had been a key al-Maliki backer but has since withdrawn his support, also denounced the barrier's construction as an "unacceptable" move by the United States, saying it feared Shiite areas in Baghdad like Sadr City would be next.
But al-Maliki is said to fear rising support among U.S.-allied Egypt, Saudi Arabia and Jordan for an Iraqi national unity government led by former Prime Minister Ayad Allawi, a favorite of Washington.
Earlier Sunday, the Sunni Iraqi Islamic Party denounced the wall's construction.
"Isolating parts of Baghdad with barbed wire and concrete barriers will inflict social and economic damage and it will lead to more sectarian tension," it said. "This measure will harm the residents and it will have a negative impact on the areas instead of solving the problems."
"Dividing the capital of Iraq in this way will be the starting point for dividing Iraq at the pretext of imposing law and security," it added.
The military said in a statement earlier this week that U.S. soldiers had begun building a five kilometer (three-mile) wall to protect the minority community on the eastern side of the Tigris River.
When the wall is finished, Azamiyah will be gated and traffic control points manned by Iraqi soldiers will be the only entries, it said, stressing that the decision had been made in coordination with the Iraqis.
It said the concrete wall "is one of the centerpieces of a new strategy by coalition and Iraqi forces to break the cycle of sectarian violence" in Baghdad.
U.S. and Iraqi forces have long erected cement barriers around marketplaces and coalition bases and outposts in Baghdad and other Iraqi cities such as Ramadi in an effort to prevent attacks, including suicide car bombs.
American forces also have constructed huge sand barriers around towns such as Tal Afar, an insurgent stronghold near the Syrian border.
But many residents were alarmed by the plan, and said they had not been consulted. "This will make the whole district a prison. This is collective punishment on the residents of Azamiyah," Ahmed al-Dulaimi, a 41-year-old engineer who lives in the area, said on Saturday.
Khalid Ibrahim, 45, said the Americans were working hard to divide Baghdad's neighborhoods - something he said he wasn't sure was a good thing.