The Iraqi government moved Friday to block access to Facebook, Twitter and YouTube in a bid to disrupt the social media tools deployed by insurgents as they have swept through the country in a bold drive toward Baghdad.

But the initiative ran into a hard reality of warfare in the 21st century: Losing physical ground means losing control of cyberspace as well.

Companies that monitor Internet traffic reported significant declines in access to social media services in Baghdad and the immediate vicinity as providers complied with censorship orders from the Ministry of Communication. Internet access in other parts of the country were disrupted to a lesser extent, if at all.

Regions beyond government control often rely on alternative sources, such as satellite links and fiber-optic lines coming from telecommunications providers in Turkey, Iran and Jordan, analysts said. Service in semiautonomous Kurdish regions, for example, appeared to be flowing without a blip.

“It kind of echoes the larger themes in Iraq, of how little the Iraqi government controls in that country,” said Doug Madory, a senior analyst with Renesys, a New Hampshire-based company that tracks Internet performance worldwide.

Internet monitoring services detected several hours of outages Monday and Thursday in Iraq. Friday’s appeared to be more sweeping and longer-lasting, continuing throughout much of the day and into the night at a time when tensions were running high and President Obama was speaking openly of possible military action.

Governments under threat often seek to block online services, especially if they are widely used by their opponents. Syria has regularly interrupted Internet access during its more than three years of civil war. Egypt shut down social media sites during the Arab Spring uprising in 2011. Iran temporarily blocked access to encrypted sites in 2012, making it impossible to have online conversations free from government snooping.

In Iraq on Friday, overall Internet traffic was running at about one-third of its usual levels, according to Akamai, a network that delivers Internet content from servers across much of the world.

“Syria, from what we’ve seen in the past, has been an all-or-nothing proposition,” said David Belson, editor of Akamai’s State of the Internet Report. “What we’re seeing in Iraq is a decline in traffic but not a complete flatline.”

The Islamic State of Iraq and Syria, a jihadi group that has seized a series of towns and cities in western and northern Iraq, has used social media to communicate and distribute its propaganda messages.

In addition to affecting Facebook, Twitter and YouTube, the outages also curbed access to WhatsApp and Viber, both of which provide instant messages through cellphones, said Collin Anderson, a researcher affiliated with the University of Pennsylvania’s Annenberg School for Communication who tested access within Iraq to thousands of top Web sites.

“Anything that’s a social media site . . . that’s what they’re going after,” Anderson said.

Facebook confirmed the outages in a statement, saying: “We are disturbed by reports of access issues in Iraq and are investigating. Limiting access to Internet services — essential for communication and commerce for millions of people — is a matter of concern for the global community.”

Google, which owns YouTube, showed disruptions across its services on a tracking program, but analysts said that may have been an inadvertent consequence of efforts to block YouTube.

“We’re seeing reports that some users are not able to access YouTube in Iraq,” Google said in a statement. “There is no technical issue on our side and we’re looking into the situation.”