Sheriff’s deputies rolled up in armored vehicles early Tuesday to a rickety house in West Oakland, targeting a group of homeless mothers whose refusal to leave became a symbol of the region’s acute housing crisis.

In the inky predawn light, the deputies broke down the door at 2928 Magnolia St. and evicted the mothers, arresting four people while demonstrators chanted in the background. The operation — which ended when police placed boards on the home and a line of caution tape on 30th Street — quelled a two-month act of civil disobedience. Yet it also stirred up feelings of anger and desperation that ricocheted into City Hall.

“My heart goes out to these courageous mothers (who) are standing up for a basic human need,” Mayor Libby Schaaf told reporters during a separate event at San Antonio Park in East Oakland.

Schaaf sharply criticized the Sheriff’s Office for showing up at 5:15 a.m. “in military outfits with guns,” and using a battering ram to enter the property.

“This is a difficult situation, and it is clear evidence that our laws are not working properly,” she added, linking the home occupation and its aftermath to a larger affordable housing shortage that has gripped Oakland and other Bay Area cities.

The group of mothers, Moms 4 Housing, had confronted Schaaf during a housing rally outside City Hall last week and asked why she had not responded to their pleas for help.

The eviction followed an Alameda County Superior Court ruling on Friday that the mothers and their children could not legally live in the ramshackle house with chipped periwinkle trim. Wedgewood Properties — a company that specializes in house-flipping — bought the home for $500,000 at a foreclosure sale last July and took possession in November, two days after the mothers came in.

A judge had said they must be evicted by Wednesday, but the women vowed to stay despite the order.

Breaking this morning: Deputies from Alameda County Sheriff’s Office have closed off several blocks of 30th Street in West Oakland to serve a court order, as per dep. on scene who referred me to media spox, (appears to be eviction of @moms4housing) pic.twitter.com/3Th3cmzIjW — Alejandro Serrano (@serrano_alej) January 14, 2020

Those arrested from inside the house were mothers Jesse Turner, 25; Tolani King, 46; and Misty Cross, 38, all of Oakland. They were arrested for resisting an eviction, authorities said. Walter Baker, 28, of Berkeley, was arrested outside the house for obstructing officers. All were taken to Santa Rita Jail in Dublin and released at about 2:30 p.m.

Representatives of Wedgewood said over the weekend that the company is willing to pay for temporary housing and moving expenses for the homeless mothers. Wedgewood plans to renovate and sell the property, sharing profits with Shelter 37, a Southern California nonprofit organization that helps at-risk youths. Several City Council members called on Wedgewood to negotiate with Oakland Community Land Trust, a nonprofit that acquires land for affordable housing, but the company refused.

In a statement Tuesday, a Wedgewood spokesman said the company “is pleased the illegal occupation of its Oakland home has ended peacefully.”

“The solution to Oakland’s housing crisis is not the redistribution of citizens’ homes through illegal break-ins and seizures by squatters,” company officials said.

Oakland faces a dire housing shortage and an explosion of homeless encampments under freeways, in public parks and on city sidewalks. The city saw a 47% increase in homelessness in just two years, and 3,210 homeless people are unsheltered, according to a point-in-time count.

Dominique Walker, one of the homeless women living in the house, said she was doing an interview at another location when deputies arrived, but she quickly returned to find two of the women she lived with had been arrested. All of the children were safe and not in the home during the eviction, she said.

“I’m really concerned about my sisters,” Walker said. “This house was a statement; it was a symbol of what needs to happen in Oakland.”

Walker called the company’s offer to shelter her and the other women an “insult.”

“That’s no offer,” she said. “We offered to buy the house — that’s what we wanted to do.”

Walker said the sheriff’s response — armored vehicles, closed streets and officers clad in riot gear — was excessive.

“This is the type of forces that we are up against when we are just trying to survive,” she said. “We are just trying to live. We just want shelter for our children, and if we have to go to jail for that, then take me.”

Protesters swarmed into the neighborhood as word of the eviction spread. Organizers dished out food from aluminum bins and had a crew of people ready to speak to the media. Bystanders lingered in front of the house for hours, occasionally chanting over the squeal of drills as authorities put up plywood to shut off access to the house.

“Shame on you,” a person in the crowd shouted as more plywood was unloaded from a truck.

Should anyone tear off the plywood and re-enter the house, Alameda County sheriff’s spokesman Ray Kelly said, it will be up to Oakland police to deal with the intruders.

As the scene calmed later that morning a few volunteers kept vigil outside the house, while neighbors emerged to do yard work or walk their dogs. Old-timers looked at the house and shook their heads, marveling at how much the neighborhood had changed. Several said they were familiar with the situation and expressed sympathy for the mothers.

Anthony Gaines, another West Oakland native, was loading tools into a car across the street from the house.

“I’m just praying for everybody,” he said. “I’ve lived here all my life. Everything is so expensive. Everything has changed,” he said. “It’s a genocide. People don’t have money; they don’t have homes.”

Tracy Smith stood on a street corner cradling her Chihuahua and talking to a friend on a scooter.

“I just hope they find something,” she said of the moms. “I hate to see someone be homeless. I’m just sad it had to come to this. I hope everything works out for them.”

Another neighbor, Ashley Pattison-Scott, said she had come by the house to deliver toilet paper and supplies to the mothers and their kids. She noted the extent of the housing crisis: One group of Oakland residents is living in shipping containers, close to the port.

Kelly described the eviction to reporters as “a tricky situation,” due to the publicity and support the mothers had drawn. When deputies arrived, he said, about five people were outside the house. The front and back doors were bolstered from the inside and police used battering rams “and a considerable amount of force” to enter, Kelly said.

Police sent a robot to make sure the house was safe to enter. Once inside, deputies called out to the inhabitants, who said they wanted to be arrested peacefully.

“We wanted to keep this as simple as possible,” Kelly said. “There were concerns for officer safety and anyone going in to intercede in this incident.” He emphasized that deputies raided the home “in the presence of the entire world and all the media watching us, and (came) away with very little impact. This is not your typical eviction.”

Five hours after the eviction, a police helicopter continued to circle even as most of the protesters packed up their lawn chairs and signs and put them in their cars.

Alejandro Serrano, Rachel Swan and Michael Cabanatuan are San Francisco Chronicle staff writers. Email: alejandro.serrano@sfchronicle.com, rswan@sfchronicle.com and mcabanatuan@sfchronicle.com Twitter: @serrano_alej, @rachelswan and @ctuan