GREENFIELD — Madelynn Malloy wakes to the sound of a car horn piercing through the thin sides of her tent pitched on the city’s historic common.
The 40-year-old is one of 20 or so homeless people who have been living in tents in this old mill city for several weeks.
“I don’t want to be sitting here as an eyesore any more than you want me to be sitting here as an eyesore. But where else do we go?” Malloy said on Monday.
After weeks of assuring the homeless they would not be forced off the common, the city’s mayor announced this week that they’d have to leave by Friday — surprising activists for the homeless and leaving the tent dwellers with few options.
The dispute over the encampment has played out for several weeks, as Greenfield, a city of about 17,000 north of Springfield, struggles with the lack of affordable housing, like many communities across New England.
In emergency talks this month, city officials began seeking other solutions to the tents, trying to expand shelter capacity by repurposing abandoned buildings and looking for affordable studio apartments or single-room occupancies.
Part of Mayor William Martin’s push to rid the common of the tents is to “allow properly scheduled events,” including the upcoming Greenfield Free Harvest Supper, scheduled for Sunday. The city also cited health code violations as a rationale to close the common.
“The mayor’s decision, it’s crazy. All these people. Where do they expect them to go?” said Tamisha Matos, 29, a diabetic who is five months’ pregnant and has been living on the common for a few weeks.
A 2014 housing study found that the city did not have enough affordable housing for its residents at the lowest income levels.
The makeshift tent town sprang up in early July, when Malloy erected the first tent on the common, amid the historic cannon, benches with dedications by the donors, and a flagpole. By mid-August, the encampment had grown to almost 20, populated by couples, single individuals, and even a family with several young boys. The group used to gather around two picnic tables, which police removed on Wednesday.
Signs went up on Wednesday saying the common will be closed until Oct. 1.
“This is closing the common to everyone, not just the tenters,” said Police Chief Robert Haigh. “[The harvest supper] is happening Sunday night, but we can’t allow it on the common.’’
The supper will relocate to the street between the common and Town Hall, an area already in use every weekend for a farmers market.
Kirsten Levitt, the executive director and chef of the pay-what-you-can Stone Soup Cafe, which runs the harvest supper and provides around 200 meals every Saturday to people in need, did not approve of the plan.
“That’s not our reputation. That’s not who we are,” she said on Wednesday. “It has nothing to do with us. It has everything to do with what the town’s doing. It’s unfair to say that it’s because of our event.”
Tenters said they thought officials were looking for an excuse to remove them.
Haigh said there have been health code violations, drug use, and even an attempted murder in the tent encampment.
Some of the people living in the tents have endured domestic violence. Others are mentally ill, or struggling with financial problems.
“Each case is different,” said captain Scott Peabody of the Salvation Army, who has been at the encampment almost every day. “All it takes is for someone to lose their job and their lives could be changed in an instant.”
The Salvation Army is the main lifeline between the tenters and the community, and is the place for free meals.
The tenters set up on the common after learning about a bylaw that exempts the area from the city’s public property regulations, which are closed at night.
As a result, Martin said Monday, the encampment is “technically not illegal,” but also “technically illegal” because none of the residents have a permit for temporary housing and are violating health codes. Martin did not respond to requests for comment Wednesday.
“This was not what I was expecting was going to happen,” said MJ Adams, Greenfield’s community development director who is the lead official helping with the encampment.
When a Monday deadline set by the Board of Health to close the encampment passed, officials said they were going to work with each person to find an individual solution to their housing issue. On Tuesday, Adams said there were talks about aiming toward mid-September removals, once every person on the common had found a place to stay.
Adams and other officials met with the tenters Wednesday to discuss next options.
Many had been living in encampments in the woods, and some only moved to the common after officials closed those camps.
“This started out as a desperate last resort and has now become a political movement,” Malloy said. “Just trying to chase us off the common isn’t going to fix the problem.”
As Wednesday wound down, Matos evaluated her options. She could stay on the common for two more nights before she faced trespassing charges, something she could not risk as she struggles to regain custody of her children.
“I’m stressed, I’m overwhelmed, and I’m depressed. All I want is for my life to be back together again,” she said.
Matos is applying for space at a nearby shelter, but doesn’t expect to have a spot there for at least a few months. Each night will be a new struggle for her.
“I don’t know where I’m going to sleep Friday night, and after,” she said, her voice cracking. “I just don’t know.”
Clarification: This story has been updated to reflect that Madelynn Malloy had moved into a shelter on Monday.
Amelia Nierenberg can be reached at amelia.nierenberg@
globe.com. Follow her on Twitter @ajnierenberg.