The Palestinian health ministry told reporters that the two men were aged 16 and 21.
A third person was wounded in the leg but is said to be in a stable condition.
"During an IDF (Israel Defence Forces) operation in the Jenin refugee camp, Palestinian gunmen opened fire on forces and assailants hurled explosive devices," the Israeli military said in a statement.
"In response to the immediate threat, forces shot towards the attackers," the statement continued, adding that no Israeli service personnel were wounded in the incident.
(With input from Reuters)