DALLAS — As a demonstration against police shootings made its way downtown here on Thursday, it differed from others around the country in one startling way: Twenty to 30 of the marchers showed up with AR-15s and other types of military-style rifles and wore them openly, with the straps slung across their shoulders and backs.

In Texas, it was not only legal. It was commonplace.

The state has long been a bastion of pro-gun sentiment and the kind of place where both Democrats and Republicans openly talk about the guns they own and carry, on their person, in their vehicles, at their offices, at their homes and even in the halls of the Texas Capitol. And in recent years, as gun rights continued to expand, activists have exploited a decades-old freedom to openly carry a rifle in public by showing up at demonstrations with their so-called long guns.

Advocates have carried their rifles at the Alamo in San Antonio and outside mosques in the Dallas suburbs. But city and county leaders said the presence of armed protesters openly carrying rifles on Thursday through downtown Dallas had created confusion for the police as the attack unfolded, and in its immediate aftermath made it more difficult for officers to distinguish between suspects and marchers.

Two men who were armed and a woman who was with them were detained, fueling an early, errant theory by the police that there was more than one gunman.