JERUSALEM — In an attack that ended months of relative quiet, Hezbollah, the Lebanese Shiite militant group, said it set off an explosive device on the border between Lebanon and Israeli-occupied territory on Tuesday, wounding two Israeli soldiers.

Hezbollah and Israel, which fought a monthlong war in 2006, have largely sought to keep the border calm amid chaos elsewhere in the region, and the quick claim of responsibility, less than four hours after the blast, came as a surprise. Hezbollah has denied responsibility for several rocket attacks into Israel in recent years; those attacks were probably carried out by Palestinian militant groups.

Israel responded with artillery fire toward two Hezbollah positions in southern Lebanon, according to the Israeli military. The military said that two blasts had occurred, but that the second had caused no injuries.

Hezbollah’s Al Manar channel said the group had detonated an explosive device in Shebaa Farms, a disputed area that Lebanon considers occupied by Israel and that Syria also claims. Israel captured the area, along with the adjacent Golan Heights, in the 1967 war and later annexed both regions in a move not recognized by the United Nations. Israel said the bombs that exploded Tuesday had been placed on the Israeli-controlled side of the border.