The Israeli Defence Ministry said the 13-year-old girl, named locally as Baraa Ramadan Eweisa, was injured in the leg near the Alfei Menashe settlement and taken to hospital on Wednesday.
Officials said she ignored orders to stop while approaching the Eliyahu checkpoint and the Israeli Defence Forces (IDF) soldiers fired warning shots into the air before shooting her.
Israeli officials said a border guard fired after Baraa reached towards her shirt but that searches of the teenager’s bag found no traces of weapons or explosives.
She told investigators “I came to die” during initial questioning, Israel’s Haaretz newspaper reported.
But Palestinian police said Baraa was shot when she tried to run away, adding that one of her relatives was killed in the same place last year while trying to stab soldiers.
An Israeli military court ordered her release on Thursday morning after ruling that she was not in possession of a knife or attempting an attack, the Palestinian Ma’an news agency reported.
Saleh Ayyoub, a lawyer with the Palestinian Prisoner’s Society (PPS), said Baraa was still being treated at Meir Hospital, in the Israeli city of Kfar Saba.
In November 2015, a woman was shot dead by border guards at the same checkpoint at Eliyahu while carrying a knife.
Rasha Owaisi, 23, of Qalqilya, had left a note to her family saying she was acting “in defence of my homeland”, adding: “I can’t bear what I see any longer. All I know is that I can’t take it.
“To my mother and brothers, please forgive me.”
It was not immediately possible to confirm whether Owaisi is an alternative spelling for Baraa’s surname, which has been transliterated from Arabic.
The shooting came amid heightened tensions in Israel and the West Bank over a year-long wave of Palestinian attacks and crackdowns by security forces.
Fresh controversy has been generated by photos of IDF soldiers beating an unarmed Palestinian man in Hebron on Tuesday.
Israeli authorities said the man was resisting arrest but launched an investigation after images showed troops holding his head down and kicked him, and a soldier kneeling on the man’s head.
Hebron, which contains the Cave of the Patriarchs/Ibrahimi Mosque, is divided between Israeli and Palestinian Authority control and has been the scene of frequent stabbing attacks, violent protests and clashes.
At least 34 Israelis and two Americans have been killed in Palestinian stabbings, shootings and car rammings since last September, while more than 200 Palestinians have been shot dead by security forces in the same period.
Israeli officials said the vast majority were carrying out or attempting attacks, but others have been killed during protests.
Several incidents have been contested and the United Nations has voiced concern over reported “excessive use of force”, calling for independent investigations into each death and injury caused by the security services.
Benjamin Netanyahu, the Israeli Prime Minister, has blamed Palestinian “incitement” for the attacks but Ban Ki-moon, the UN Secretary General, said the violence was “bred from nearly five decades of Israeli occupation” and the result of “fear, humiliation, frustration and mistrust” among Palestinians.
Barack Obama broached the issue during talks with Mr Netanyahu on Wednesday, voicing concerns about the expansion of Israeli settlements in the Occupied Palestinian Territories, which are regarded as illegal under international law.
“Clearly there is great danger of not just terrorism but also flare-ups of violence,” the US President said.
“We do have concerns around settlement activity as well. And our hope is that we can continue to be an effective partner with Israel in finding a path to peace.”
In addition to its estimate of 2.7 million Palestinians in the West Bank, the CIA Factbook says about 371,000 Israeli settlers were living in the West Bank as of July 2015. Neither figure includes East Jerusalem, which both sides claim.
Join our commenting forum
Join thought-provoking conversations, follow other Independent readers and see their replies