The officer faced her impassively, absorbing some blows, evading others, but never striking back at her, then finally turned and, with his comrade, walked away. A few days later, a clip of the scuffle was broadcast on Israeli television, setting off a debate on both sides of the conflict and turning the blonde, blue-eyed and seemingly fearless teenager into a hero for supporters of the Palestinian cause.

Israelis argued over whether the soldiers had demonstrated admirable forbearance and fortitude or a kind of weakness and vulnerability that could send dangerous signals to the country’s enemies. Palestinians, while showering Ms. Tamimi with praise, asked whether publicizing the video might have been counterproductive, by showing the soldiers behaving with restraint, or helpful, by showing that even unarmed resistance can be effective.

But Ms. Tamimi, whose family is well known for its protests against the Israeli occupation of the West Bank, also quickly became a symbol of how harshly the military justice system can treat young Palestinians. She was arrested in the middle of the night after the video’s broadcast on television. Her mother and a 20-year-old cousin, Nour Tamimi, were also charged. And their trial in a military prison was closed to the news media to protect Ms. Tamimi’s privacy, according to Israeli officials, though her defense lawyer, Gabi Lasky, asked to waive that, insisting that publicity would provide far better protection.

All three women agreed to plea bargains on Wednesday. Ahed Tamimi pleaded guilty to attacking the soldier and to two other counts of disrupting a soldier and incitement, the Israeli military said. Other charges, including stone-throwing, were dropped.

Nour Tamimi was sentenced to the time she had spent behind bars before being released on bail, about two weeks. Ahed’s mother, Nariman Tamimi, who was charged with incitement for showing the altercation live on Facebook, was sentenced to eight months in prison, a suspended sentence and a fine of about $1,700. Mother and daughter are both expected to be released in July.