The nearly five-year civil war in Syria has exposed some of the difficulties that military forces have conducting intelligence, surveillance and reconnaissance against terrorists and insurgents in crowded urban environments. These challenges, while not insurmountable, will continue to plague even the most advanced military forces, including the United States, as migration out of rural areas and into cities continues unabated. For the foreseeable future, deterring and countering near-peer adversaries such as Russia and China will undoubtedly remain at the forefront of American grand strategy. But in addition to meeting the challenges associated with traditional and well-known state-based threats, the US military will be expected to combat an array of violent non-state actors — a blanket term that includes well-established groups like Islamic State, al Qaeda and the transnational criminal gang MS-13 but also countless other and less well-known militias, insurgent groups and terrorist organizations. Countering violent non-state actors will almost assuredly force the US military to engage in operations in or on the edge of densely populated “megacities,” urban areas that seep into one another and have more than 10 million inhabitants. This is problematic. Military missions even in relatively small built-up areas are inherently complex endeavors. Buildings and masses of people can provide cover and concealment to hostile actors and their operations. These features can also reduce the effectiveness of the intelligence, surveillance, and reconnaissance platforms the military needs to successfully conduct operations. The larger and more complex the city, the more pronounced these challenges become. Popular conceptions of megacities are drawn from the futuristic and dystopian stories often presented in science fiction. The urban sprawl and enormous concentration of people was depicted in the 1995 film “Judge Dredd,” where a megacity is the locus of crime and armed gangs, and a host of social ills run rampant. While a single metropolis extending from Boston to Washington, D.C., or from San Francisco to San Diego might seem far-fetched, megacities do exist and are only expected to become more common. In 2015, 27 regions worldwide fit the definition of megacity but projections by the National Intelligence Council suggest that over the next decade and a half, urban growth will result in more than a dozen more, with many of them in Africa and Asia. Because of the sheer size of megacities and the challenges associated with their governance, some of these urban redoubts will likely be characterized by areas of lawlessness and sizable “no-go zones,” making them ripe targets for violent non-state actor recruitment and funding activities. In such areas, these actors will be able to create and/or take advantage of black markets, shadow governance, illicit economies and dark networks to generate revenue and recruit new members over long periods. As has been demonstrated in places like Russia’s Grozny and Iraq’s Sadr City, countering violent non-state actors in dense urban environments can prove enormously difficult even for highly capable military forces. Grozny’s population is in the hundreds of thousands and Sadr City’s is around 3.5 million. When illicit actors become firmly entrenched in an urban environment and garner widespread support from among the population (like they were in Grozny in the 1990s and Sadr City during the Iraq War), successfully countering their activities requires a significant application of time and military resources. An ongoing example of how violent non-state actors might operate in megacities can be seen in Islamic State-controlled territory in Iraq and Syria, where the terror group maintains disparate and lucrative income sources, including bakeries, oil refineries, and utilities and simultaneously recruits new members not only from within areas they control, but also from throughout the world. Consider the case of Raqqa, the IS-stronghold and the group’s current center of gravity. Raqqa is not a megacity since it has only about 250,000 residents. But because members of IS live alongside and operate among Raqqa’s population, military forces operating in Syria have had difficulty reconnoitering, targeting and striking the group from the air. Even when targeted successfully, concerns over causing collateral damage have led the US military to call off certain tactical strikes, which in turn have limited the scope and effectiveness of the overall military operation. In an effort to prevent or deter ground incursions, IS also has likely booby trapped and ringed the city with improvised explosive devices. Now, imagine a city similar to Raqqa that is 40 times larger, much more densely populated and fiercely loyal to the violent non-state actors conducting operations there. The challenges associated with successfully countering such a foe in a city of this size are difficult to overstate. Undoubtedly, military overmatch — especially in respect to intelligence, surveillance and reconnaissance capabilities — is a concern for irregular forces and one of the reasons why they choose to operate in densely populated urban environments. These capabilities are a crucial element of urban operations: They enable modern militaries to see the battlespace, track adversary movements and, ultimately, conduct air and ground operations to their fullest effect, while reducing the likelihood of friendly and civilian casualties. But the sheer volume of people, vehicles and buildings present complicates the equation, causing these challenges to grow not only in magnitude but also in kind. The electronic and cyber fog formed by the pervasive use of cheap and encrypted mobile communications devices has the potential to overwhelm the US military’s optical-electrical surveillance platforms and limit its capacity for effectively targeting and tracking the activities of hostile sub-state actors. The relative ease associated with surreptitiously constructing and emplacing IEDs and the continued proliferation of unmanned aerial systems — including smaller, commercially available drones — for counter-surveillance purposes will provide an added layer of complexity to an already complicated problem set. To counter violent non-state actors operating in the future in megacities, the US military will have to be able to effectively piece together a comprehensive and actionable intelligence picture, and under enormously challenging circumstances. This will require, at a minimum, an ability to persistently monitor, collect and interpret — in near real-time — the millions of bits of data associated with cellphone communications, social media postings, financial transactions and the operational movements of these actors. The challenges associated with doing so — exposed in Grozny, Sadr City and now Raqqa — will likely require the US military to increase the number of intelligence platforms it employs and to develop the ability to manage and interpret in a timely fashion the unending stream of data. Failure to do so will exacerbate the difficulties associated with operating in megacities, prolong conflicts therein, and create circumstances where hostile groups can exploit physical and virtual sanctuaries largely unobserved by US forces. Chad C. Serena is a political scientist and Colin P. Clarke is an associate political scientist at the nonprofit, nonpartisan RAND Corporation.