MADISON, Wis. — As darkness fell on a humid Wisconsin night, some of the several dozen homeless people who sleep outside City Hall began to unfurl their sleeping bags and settle in. But Nancy Griswold, 49, was restless: She sat on a concrete bench next to a black roller bag full of her belongings and surveyed the scene with the crisp confidence of a docent at the state Capitol, only a block away.

“They drink over there in that corner,” she said, pointing to a grassy patch to the south. “This couple next to me is pretty quiet. Over there is fightland. You don’t want to go near it.

“And over here there’s about a thousand mice,” she said, as one scampered past her feet.

Beginning Oct. 1, everyone here will have to clear out. Facing a sharp increase in homelessness and fed up over what he says is a hot spot for violence and illegal activity, Madison’s Democratic mayor, Paul Soglin, successfully pushed for a measure last month that will ban anyone from sleeping at night outside City Hall, shutting down what has become Madison’s most public de facto homeless shelter.

Mr. Soglin has attributed the problem of homelessness in part to inadequate affordable housing, one of the lowest vacancy rates in the nation and a shortage of social workers to handle all of the newly homeless people. But he has also pointed to Madison’s reputation as a cozy liberal bastion, saying that many people who have recently begun to camp out in large numbers downtown are here because they expect to find low-cost housing, beds in shelters or social services that might be harder to find in smaller, more rural towns.