The incident occurred in the Palestinian city of Nablus, which the military said soldiers had entered to detain a Palestinian, whom it did not identify.
"Some Palestinian gunmen began firing at the soldiers, prompting them to respond and kill one of them," a military spokesman wrote on Twitter. "The wanted man was arrested. There were no casualties among our forces."
The West Bank has seen sporadic violence since US-sponsored talks on founding a Palestinian state alongside Israel stalled in 2014.