In response, IDF tanks and Israeli Air Force fight jets attacked Hamas targets in northern Gaza.
Violence along the Israel-Gaza border has flared since U.S. President Donald Trump's recognition last week of Jerusalem as Israel's capital and the Israeli military's demolition on Sunday of a cross-border tunnel it said was dug by Hamas, the Islamist group that controls the small coastal enclave.
Family members at the hospital where the bodies were taken told AFP the two men were members of Islamic Jihad, a militant group that fought alongside Hamas in the last war with Israel in 2014.
The two men were reportedly riding through the town of Beit Lahiya on Tuesday when their motorcycle exploded. The rocket was successfully intercepted by an Iron Dome battery.
As well as tunnels under the border with Israel, there are also tunnels that run underneath Gaza's border with Egypt, which are used to smuggle in food and other supplies, as well as weapons.
An incomplete tunnel running for more than a kilometer from Gaza into southern Israel has been destroyed, Israel's army announced on Sunday.
Hamas threatened Israel with a "heavy price" for demolishing the tunnel.
He did not elaborate on how Israel knew Hamas was responsible for the tunnel, which he said reached to within 1km (0.6 miles) of the nearest Israeli civilian community.
So far, the IDF has confirmed that Iron Dome shot down one rocket launched from Gaza. A second rocket that was sacked was intercepted by the Iron Dome. At least ten terrorists were injured, of which two were killed.
Hours after two rockets that were fired by Palestinians landed near Israel's border with Gaza on Monday night, a rocket siren was sounded in the Hof Ashkelon and Lakhish regional councils.