BAGHDAD — Iraqi authorities have detained a few hundred foreign contractors in recent weeks, industry officials say, including many Americans who work for the United States Embassy, in one of the first major signs of the Iraqi government’s asserting its sovereignty after the American troop withdrawal last month.

The detentions have occurred largely at the airport in Baghdad and at checkpoints around the capital after the Iraqi authorities raised questions about the contractors’ documents, including visas, weapons permits and authorizations to drive certain routes. Although no formal charges have been filed, the detentions have lasted from a few hours to nearly three weeks.

The crackdown comes amid other moves by the Iraqi government to take over functions that had been performed by the United States military and to claim areas of the country it had controlled. In the final weeks of the military withdrawal, the son of Iraq’s prime minister began evicting Western companies and contractors from the heavily fortified Green Zone, which had been the heart of the United States military operation for much of the war.

Just after the last American troops left in December, the Iraqis stopped issuing and renewing many weapons licenses and other authorizations. The restrictions created a sequence of events in which contractors were being detained for having expired documents that the government would not renew.