The Israeli military said the militant was killed when troops opened fire on Palestinians trying to plant an explosive device close to the border .