“We can’t even go see them,” said Mohamed Hassan, an Iraqi sheik who took part in the protest. Like many others, Mr. Hassan complained that the refugees were being treated like criminals, kept under military guard in 11 school buildings and one mosque and denied any visitors or permission to leave the centers.

“We want to welcome them in our homes,” Mr. Hassan said. “We want to offer them food and a good place to stay, just as they did for us when we were in Syria.” Another protester shouted, “We will sleep in the street and let them stay inside our houses — why are you scared to let them out?”

Officially, the United Nations high commissioner for refugees, António Guterres, has thanked all of Syria’s Muslim neighbors, including Iraq, for taking in refugees. The agency has registered 120,000 Syrian refugees but acknowledges that there are probably many more. Iraq, the country with the longest Syrian border, has received the fewest, just 8,445 in the United Nations count. Jordan says it has already taken in 140,000, and Turkey has registered 88,000 by the United Nation’s reckoning.

“I am extremely grateful Jordan, Lebanon, Iraq and Turkey have maintained open borders,” Mr. Guterres said.

In Qaim, United Nations workers said refugees were being treated properly, but that only those who have Iraqi passports or visas were being allowed to leave the school. “I can only assume that some of the Syrians are distraught, suspicious and do not understand why they are asked to stay in the school as compared to the others, who have passports and can thus go to family and friends,” one United Nations official in Qaim wrote in an e-mail to the refugee commissioner’s headquarters in Geneva, a copy of which was obtained by The New York Times with the sender’s name deleted.

On Wednesday, the first day after the Iraqis opened the border, about 800 Syrians crossed over here, but the following day only 60 did so, apparently because the Syrian rebel forces on the other side began warning people of the unpleasant reception awaiting them, Iraqi officials said.