JERUSALEM (JTA) — Israel’s military destroyed a Hamas terror tunnel that reached several yards into the sea, which would have allowed the group’s naval commandos to launch an attack on Israel from its coast.

The tunnel was destroyed by the Air Force on June 3, when Israel carried out several airstrikes on Gaza in retaliation for rocket and mortar fire on southern Israel, the IDF said in a statement issued on Sunday, a week after the airstrikes.

The IDF said that it has known about the tunnel for several months and was waiting for the right time to destroy it. Hamas divers would have been able to discretely enter Israel in a short amount of time by using the tunnel, according to the IDF.

“The IDF will not allow any threat to the security of the State of Israel and will continue to act with determination against terror of all kinds. The IDF is determined to continue performing its task of defending the citizens of the State of Israel and its sovereignty,” it said in a statement posted on social media.

Hamas has been increasing its naval prowess and power for some time, a senior Navy official said in a statement.