The soldiers operating in the al-Ein refugee camp saw a Palestinian gunman who fired at them before they returned fire and hit him, the army said.
Palestinian doctors said a member of an offshoot of the Popular Front for the Liberation of Palestine was killed with a bullet to the head.
The troops also encountered grenades that were thrown at them, the army said. No soldiers were injured.
The Israeli army operates almost nightly in Nablus, which is considered a hotbed of anti-Israeli activity, and gunmen are frequently killed in exchanges of fire.
On Monday, an Israeli missile strike killed six Hamas operatives in the Gaza Strip, making it the deadliest day for many weeks in action between Israeli troops and Palestinian gunmen.
Reuters contributed to the report