Brad Lander, the former New York City comptroller and current Democratic nominee for the state’s 10th Congressional District, said Wednesday he’d been detained by the Israel Defense Forces while he was helping Palestinian farmers pick olives in the occupied West Bank.

He announced he’d been released just before 10 a.m. Wednesday.

In a post on X, Lander said Israeli forces had detained him along with a group of rabbis and volunteers who had been harvesting olives near the village of Nahalin, outside Bethlehem.

“The occupation is a crime under international law. Harvesting olives isn’t a crime under any law I know,” he wrote.

In a follow-up post three hours later, Lander said he was released with a warning “apparently because of my public profile.” He added that several dozen other participants were still being detained and “should all be released immediately.”

The Israeli Foreign Ministry called Lander’s participation in the harvest a “calculated political provocation.”

“Lander traveled to a foreign country, deliberately entered a restricted security area, and participated in an unauthorized activity without the required coordination,” the ministry wrote on X. “Brad Lander came looking for a confrontation. Now he is pretending to be its victim.”

Rabbis for Human Rights was among the groups that helped organize the olive harvest. Acting Director Anton Goodman said he was detained alongside Lander Wednesday morning. He spoke to Gothamist by phone and said he was still being held at an Israeli police station in the West Bank.

Goodman said the group of about 70 Israeli and international volunteers arrived Wednesday morning to work in Nahalin, a Palestinian village southwest of Bethlehem. They hoped to harvest olive groves that Palestinian farmers hadn’t been able to access for three years, he said.

“This is a pastoral area,” Goodman said. “It’s beautiful. It’s ancient terracing. And on each level of the terraces are groups of olive trees that are owned by different families from the village.”

The area where they were working was a few hundred meters from an Israeli settlement, Goodman said. The volunteers went plot by plot, bagging olives to take back to the village. Only a small number of Palestinians joined them because, Goodman said. “The majority were scared to be there.”

After about an hour-and-a-half, he said, a large group of “Israeli security forces, police, army” approached the group and said the area had been designated a closed military zone that morning.

“I said to them, ‘We will respect it and we will leave.’ And they said, ‘No, we’re going to detain you all,’” Goodman said.

Goodman, who described himself as an Orthodox Jew, said about 15 rabbis from across denominations were in the group.

“The work that we were doing is a work of Jewish identity as well,” he said.

Mayor Zohran Mamdani wrote on X that he was thankful Lander had been released but that other New Yorkers remained detained and “must be released immediately.”

“Harvesting olives is not illegal,” Mamdani wrote. “The occupation is.”

Lander had announced earlier in the week that he was in the West Bank with the “Protect the Harvest” coalition. He said the group was helping Palestinian farmers harvest olives in the face of “state-sanctioned settler terrorism” and drawing attention to the occupation.

The trip comes as settler attacks during this year’s harvest have drawn international condemnation. Last week, settlers attacked a Washington Post photojournalist, and the following day they attacked a delegation of European diplomats.

Lander, a close ally of Mayor Zohran Mamdani, unseated Rep. Dan Goldman in the June Democratic primary. Israel was a major issue on the campaign trail. Lander has accused Israel of genocide in Gaza.

The State Department did not immediately respond to a request for comment.

This story has been updated with additional information.