HALHOUL, West Bank — Sharing a cell inside an Israeli prison, the Palestinian girls would toss baskets and play a game they called shuffle ball. There were academic classes in the afternoon, and sometimes an Arab-Israeli prisoner known as Auntie Lina would braid their hair.

In the evenings, Dima al-Wawi, a 12-year-old arrested in February with a knife at the entrance to an Israeli settlement in the occupied West Bank, would sing Palestinian nationalist anthems with Istabraq Noor, 14, who was accused of trying to sneak into a different settlement to attack Jewish residents in October.

“Mom, I didn’t even cry once!” Dima boasted upon being released on Sunday after serving about half of her four-and-a-half-month sentence.

“Not even for us?” asked her mother, Sabha, 47.

“Only under the covers,” she replied. “At night.”

There were a dozen such girls with similar cases in Israeli custody before Dima’s release, up from one in September — part of a surge in Palestinian minors incarcerated during a wave of violence that has killed about 30 Israelis in the last seven months. Assaf Liberati, a spokesman for the prison service, said the number of Palestinian prisoners under 18 more than doubled, to 430 from 170 before the stabbings, shootings and vehicular attacks began on Oct. 1. Of them, 103 were 16 or younger, up from 32.