SAN JOSE, Calif. — Police and social-service workers on Thursday began clearing away one of the nation’s largest homeless encampments, a cluster of flimsy tents and plywood shelters that once housed more than 200 people in the heart of wealthy Silicon Valley.

Al Palaces, a former truck driver who moved in about eight months ago, was among those ordered to leave the camp known as the “Jungle,” which city officials have been trying to eliminate for years.

“I just grabbed whatever I could because I don’t want to go to jail,” he said, standing next to an overloaded shopping cart stuffed with muddy plastic bags.

On Monday, people living in the camp were given until dawn Thursday to leave or face arrest for trespassing. By Thursday morning, about 60 people were left at the muddy, garbage-strewn site.

Many people had trouble dragging their belongings out of the camp through ankle-deep mud.

“It’s junk to everyone else. But to us, these are our homes,” said Nancy Ortega, who said she had been in and out of jail and struggled with addiction and mental illness.

By midmorning, dozens had been moved out after abandoning most of their possessions, but some of the homeless remained.

Valentine Cortes, who said he was a journeyman construction worker, had no plans to leave his makeshift shelter.

“I don’t know why people got all chaotic today,” he said. “We don’t have to go.”

Asked about the warning that anyone who stays could be jailed, he shrugged and said, “Then I guess I’ll be arrested.”

Rats could be seen running through the muck.

A few dozen protesters held signs reading “Homeless people matter” and “Stand with The Jungle.”

Palaces said he liked the Jungle better than the streets because people would bring food but not bother the residents.

“Even a job wouldn’t give me a house” because housing prices are so high, he said.

Officials planned to try to find shelter for the night for those homeless people connected with social services. Anyone not linked with social services still has to leave, San Jose homelessness response manager Ray Bramson said.

San Jose has spent more than $4 million over the last year and a half to solve problems at the encampment.

In the last month, one camp resident tried to strangle someone. Another was nearly beaten to death with a hammer. And state water regulators have been demanding that polluted Coyote Creek, which cuts through the middle of the camp, gets cleaned out.

Personal property confiscated Thursday was to be stored for 90 days before being disposed of in March.