HARRISBURG - The crows roosting around the Pennsylvania Capitol this autumn won't be gathering in peace much longer. Any day now, Capitol police officers will set out around dusk, toting shotguns with bright orange barrels, and scout out a cluster of crows.

On a recent evening, it was hard to miss the birds flying around the trees to one side of the Capitol, cawing and rustling the leaves. When the officers come upon the crows, they will fire exploding shells - which may alarm the birds, but won't harm them - and then keep firing until the birds have flown off the Capitol grounds.

"After a while, they get the point," said Troy Thompson, spokesman for the Department of General Services, which oversees the program.

The problem with the crows is the mess they leave on sidewalks, which appear splatter-painted beneath the roosts and can become slippery when it rains, and on the buildings, the exteriors of which can be damaged.

And so every year since 1997, according to the department, the Capitol police have worked to scare the crows away.

Crows have been gathering in large flocks in southern Pennsylvania for hundreds of years, but have been roosting in cities just in recent decades, said Kevin McGowan, an ornithologist at the Cornell Lab of Ornithology.

It's not known for sure why crows began spending the night in urban settings, McGowan said, but he noted that in the 1970s crows were added to the federal law that protects birds, cutting down on action by their human predators.

Once in the city, there's a lot for crows to like, experts say. Cities are warmer than surrounding areas, with enough light to help crows spot owls and large trees in which they can sleep. Harrisburg is a compact city, making it easy for crows to roost by the well-lit Capitol at night while dining in the outlying agricultural areas by day, said Margaret Brittingham, a professor of wildlife resources at Pennsylvania State University.

"The roosts sort of act as a hotel for them," she said.

Migrant crows, down from Canada for the winter, mingle with crows who live here year-round. (That's one reason roosts in Pennsylvania can get so large, McGowan said.) The roosts - gatherings where the crows sleep and hang out - provide protection from predators as well as a social scene. "If you are looking for a mate, there's a good place to check out a few chicks, if you will," McGowan said.

While there are roosts all over, some of the larger ones in Pennsylvania have been found in Lancaster, Harrisburg, and State College, according to Harris Glass, the Pennsylvania director of the wildlife services program of the U.S. Department of Agriculture.

At its high point, the Lancaster roost was home to nearly 40,000 birds, making such a mess that car dealerships had to wash their cars daily, Glass said. But a campaign of harassment - that's what the efforts to bother the crows are called - broke up the roost, leaving it with about 10,000 to 15,000 crows now, he said.

Loud bangs are not the only way to scare off crows. The Capitol police used to use recordings of crows in distress, Thompson said. Penn State reported in January 2014 that crows had adapted to its use of laser pointers and that it had switched "to more aggressive techniques" of pyrotechnic bangers and screamers. Crow effigies - which can be purchased at Halloween stores - can be hung up, to suggest that a fellow crow has died.

The officers who fire toward the crows could find themselves recognized by their targets.

Crows can identify individual people, and don't forget them, said John Marzluff, a professor of wildlife science at the University of Washington.

"You want to be on the good side of a crow," Marzluff said. "They will remember you for life."

He said crows could scold the officers with harsh caws, fly away from them, or even mob them with the help of a flock.

Marzluff said that harassment efforts can be effective at dispersing crows, but he cautioned that it matters where the birds go: If they move to a wild area, or a park along the river, that's great, but not if they are driven to a poor neighborhood.

Thompson, with the Department of General Services, said he is not aware of any complaints about the dispersal program.

The Capitol police had planned to start firing the exploding shells this week, but the session was called off because of high winds. The officers could now head out any day, and will continue through the winter months.

717-787-2141 @karen_langley