The men packing the boat with rice, cigarettes and medicine had fled war and persecution in their home countries.

Now, at 1 a.m., off the coast of a remote island in Papua New Guinea, they were speeding back to the detention camp they hated.

Why, I asked, would they return to the prisonlike “refugee processing center” where they had been trapped for nearly five years?

“We have brothers to feed,” said Behnam Satah, 31, a Kurdish asylum seeker, as we cruised over moon-silvered waves on a hot November night. “We have brothers who need help.”

More than 1,300 asylum seekers have been dumped on Manus Island since the end of 2012 as part of Australia’s contentious policy to keep migrants from reaching its shores. They were all but forgotten until last month when Australia’s attempt to shut down the center and move the men to facilities near the island’s main town of Lorengau hit resistance.

Hundreds of the men refused to leave.

Many said they were afraid to move closer to town, where some had been attacked and robbed by local residents. But it was more than that. With the attention of the world finally on them, the camp’s detainees had turned their prison into a protest, braving a lack of water, electricity and food to try to jog loose a little compassion from the world.

They had already suffered and understood danger. Fleeing more than a dozen countries, they had risked their lives with human traffickers on ramshackle boats leaving Indonesia. And ever since the compound started filling up in 2013, it has been plagued by illness, suicide and complaints of mistreatment.

But now, by staying there and sneaking in and out by boat, they were risking arrest in a desperate search for self-determination, and to intensify scrutiny of Australia’s migration policy and methods.

And that scrutiny has come.

Veteran United Nations officials said this month they had never seen a wealthy democracy go to such extremes to punish asylum seekers and push them away.

Papua New Guinea officials and local leaders, enraged at how the camp’s closure was handled, have demanded to know why Australia is not doing more to help the men.

Instead, Australia is cutting services — reducing caseworkers and no longer providing medication, officials said, even though approximately 8 in 10 of the men suffer from anxiety disorders, depression and other issues largely caused by detention, according to a 2016 independent study.

“It’s a very drastic reduction,” said Catherine Stubberfield, a spokeswoman for the United Nations refugee agency, who recently visited Manus.

Australia’s Department of Immigration and Border Protection did not answer questions about the service cuts. In a statement, it said general health care was still available and “alternative accommodation sites” were “operational” and “suitable.”

Prime Minister Malcolm Turnbull has also doubled down on Australia’s hard-line approach, arguing that offshore detention has been a successful deterrent against illegal trafficking.

But in Papua New Guinea, deterrence increasingly looks like an incentive for cruelty. Officials, Manus residents and outside experts all argue that Australia has a responsibility to those it placed here, to international law, and to its closest neighbor.

“They’ve put the burden on a former colony which does not have the resources for many of the things its own people want, like health care and a social safety net,” said Paige West, a Columbia University anthropologist who has done extensive fieldwork on Manus. “This is a problem created by Australia’s failure to comply with its human rights obligations.”

The detention center, a warren of barracks and tents, sprawls across a naval base used by American troops in 1944 during World War II. The Papua New Guinea Supreme Court ruled in 2016 that the camp was illegal, calling it a violation of “personal liberty.” The governments of Australia and Papua New Guinea agreed in April to close the site by Oct. 31.

But finding alternatives has been a struggle.

Some of the men at the camp — all of whom were caught at trying to reach Australia by boat — have been granted refugee status and are hoping for relocation to the United States, under a deal brokered by President Obama and initially opposed by President Trump.

But nearly 200 of the 843 men still stuck on Manus (women and children were sent to the island of Nauru) have not had their asylum claims fully processed, or their claims have been rejected, leaving them effectively stuck on the island.

For now, all of the detainees are expected to move to three smaller facilities, near Lorengau, a few miles from the camp.

Lorengau is not a big place. It is a close-knit rural town with a few thousand people, a single supermarket, a rusty playground and electricity that comes and goes.

The new detention facilities are set apart from main roads and are closely guarded — we were turned away when a photographer and I tried to visit. But detainees can come and go. And photos, taken by the men, show that none of the facilities were fully operational more than a week after the move was supposed to happen.

At one of the new facilities, West Lorengau Haus, the electricity and water had not been turned on when representatives of the United Nations refugee agency visited days after the main camp had officially closed.

“It’s still a construction site — you can’t just move refugees into that space,” said Ms. Stubberfield, the spokeswoman.

The two other sites also had problems: One had intermittent running water, and the other, the East Lorengau Transit Center, lacked caseworkers.

Kepo Pomat, who owns the land that facility occupies, said he had issued the authorities an ultimatum: If his company did not receive the caseworker employment contracts, he would kick the refugees off his property.

Part of the problem is that the governments of Australia and Papua New Guinea are at odds over who is responsible for the men. Australia says Papua New Guinea is in charge of providing for them. Papua New Guinea says it is willing to house the refugees, but it is Australia’s responsibility to pay for them and pursue ways for them to leave.

“We’ve been urging that the Australians keep up their responsibility,” said Duncan Joseph, a community leader and the island’s Red Cross representative. “The fact that they’ve withdrawn and drastically scaled back services doesn’t change that for us, morally and legally, they are responsible for these men.”

Many of the detainees who have moved to the new sites reported crowded dormitories and delays with getting food. Some did not receive the weekly stipend of $30 for medicine and incidentals they were promised upon arrival.

Mohyadin Omar, 27, a lawyer with a soft demeanor who fled Somalia in 2013, said the move to the transit center had made him consider returning to Mogadishu. He is a certified refugee who lost his entire family to war. He fears he will be killed back home, but he may go anyway.

“I’m tortured four years here,” he said. “I’m done.”

Back inside the main detention camp, conditions deteriorated quickly after the Australians officially left on Oct. 31, cutting off the electricity and water before departing.

In the equatorial heat, the men who were sick got sicker. Asthmatics needed inhalers. Diabetics needed insulin.

Mr. Satah, the leader of the supply operation, seemed relieved when our boat pushed ashore. The navy guards and police meant to keep everything out of the camp either did not see us or chose not to intervene. Mr. Satah, a fast-talking former English teacher, smiled he led a dozen men carrying food and medicine toward a container inside the compound.

“O.K. Brothers, thank you very much — love you, love you,” he said, echoing their expressions of appreciation.

Though it was after 2 a.m., many of the men were eager to guide me through the camp, where most had lived for more than four years, in many cases without ever leaving.

They showed off the well they had dug for water, and the protest signs they posted on Twitter using cracked cellphones, cherished like fine crystal.

Some of the men who stayed at the camp appeared mentally stronger than those who had relocated.

They made clear they want to be resettled in a third country, neither Australia nor Papua New Guinea. In the meantime, they were surviving. They were defying the authorities. Thanks in part to money from supportive Australians and local boat pilots risking arrest, they had cigarettes, a stash of booze, and a measure of what they have most craved: agency and autonomy.

“There are many things that brought us to the point where we’ve said we will never go,” Mr. Satah said when he was still in Lorengau gathering supplies. “But remember, we didn’t come here by choice.”

Behrouz Boochani, another Iranian Kurd who has become well-known for writing from the camp, put it more simply in a resistance manifesto: “All the conversations are driven by one thing, and one thing only, and that is freedom,” he wrote. “Only freedom.”

Why then have more of the men not tried to pursue a future in Papua New Guinea? After I spent time in Lorengau, it became clear: Even for those who have made a life in Manus, there are real challenges.

Mustafizah Rahman, 25, an asylum seeker from Bangladesh, married a local woman and opened a shop in a red shipping container near the main Lorengau market.

There, he said, he is pursuing his dream “to become a multimillionaire.”

The island’s residents consider him a model of integration. But Mr. Rahman, whose wife is eight months pregnant, remains stateless, he said, without formal residency in Papua New Guinea.

Lorengau has become increasingly crowded with climate change refugees who have moved there from more remote islands, and Mr. Rahman said he was barely getting by after paying for rising rent and food costs.

“Not everyone can do this,” Mr. Rahman said, between customers. “We’re really not accepted in this country. If they bring everyone to town, many people will die.”

The fear of violence is shared by many of the asylum seekers, who have been targets of attacks in Manus and in other parts of Papua New Guinea, as they have been in other countries. A recent Human Rights Watch report documented a series of cellphones thefts and attacks, some involving machetes.

Kakau Karani, Lorengau’s acting mayor, said that the risks were exaggerated and that in fact, many residents had provided the men with food, lodging and work.

Around 10 children have been born to asylum seekers and local women, the mayor said, adding, “If we weren’t friendly, we would not be making babies here.”

Other residents worry that the men are preying on local women.

Ultimately, both the asylum seekers and the local residents are a mix of potential and risks.

Some of the detainees are resilient and have learned new languages. Others survive with sleeping pills or drink too much — as do some local men.

Australia says offshore detention has reduced trafficking and deaths at sea. Mr. Turnbull has rejected an offer from New Zealand to take 150 of the refugees, arguing it would encourage traffickers.

But for Manus, the effects are evolving and still being tallied. Six detainees have died here. A small number have reached Australia for medical treatment. Hundreds have left, after agreeing to deportation. And 54 refugees from Manus and Nauru have made it to the United States.

When might more follow?

Yassir Hussein, one of the camp’s leaders, said he often contemplated ideals like liberty and justice — and what they mean for migration’s winners and losers.

“We are happy for the lucky ones,” he said. “But why are they lucky? Why are we not lucky?”