As casualties mount and calls  for a ceasefire grow, the war  in Gaza is probably close to  quitting time. But nobody should be foolish enough to think that silencing the guns will mean a return to the pre-war status quo.

For Israel, a business-as-usual approach is no longer possible. The barrage of Hamas rockets cannot be tolerated again because the weapons’ increased range puts the entire population in harm’s way.

But something else also happened in the last two weeks, and the shock waves are just starting to roll through Israeli society. The discovery of Hamas’ vast tunnel system, which would have allowed thousands of terrorists to cross under the border and emerge inside the Jewish state to carry out surprise attacks, was a wake-up call that is certain to lead to a harder national line against the Palestinians.

Prime Minister Benjamin Netanyahu already declared that the threat caused by the tunnels means Israel cannot accept a fully sovereign Palestinian state in the West Bank.

“If we were to pull out of Judea and Samaria, like they tell us to,” he said in a speech four days after the war began, “there’d be a possibility of thousands of tunnels” being dug to attack Israel.

Noting that the West Bank is 20 times the size of Gaza, he said his country would never “create ­another 20 Gazas.”

Veteran Israeli journalist David Horovitz, writing in the Times of Israel, said the speech “spells the end” of any notion that the prime minister would ever agree to the kind of free Palestinian state that President Obama and most of Europe, along with the Palestinians, demand.

“This is not merely demanding a demilitarized Palestine,” Horovitz wrote of the speech. “It is insisting upon ongoing Israeli security oversight inside and at the borders of the West Bank.”

A widely discussed corollary is that Israel might not pull completely out of Gaza, as it did in 2005 and after subsequent invasions. What it will do isn’t clear, but it is determined not to allow Hamas to ­replenish its weapons stockpile and provoke another war.

Coming as Islamic radicals gain strength and territory in Syria, Iraq and large parts of North Africa, the revelation that Israel was close to a catastrophe has been deeply unsettling. The prospect of an underground invasion causing mass casualties was not taken seriously before.

It would be too much to credit Hamas with a strategy of using rocket fire as a diversion from its aim of massing underground, but, in truth, Israelis were better prepared to shoot down rockets in the sky than to expect Hamas fighters to emerge from beneath their feet. Military leaders openly concede they did not appreciate how many tunnels there were — scores have been found — and how extensively they penetrated into Israel.

Indeed, it was only after a successful attack from a shaft that Netanyahu ordered the ground invasion. Much of the work of Israeli soldiers in Gaza, and most of their casualties, have been linked to locating, searching and destroying the underground network.

These were no simple holes in the ground. Most had entrances hidden in Gaza buildings and were up to 90 feet deep, while some ran for more than a mile under the border. Some had electricity and telephones and storage areas for weapons and supplies. The largest were, effectively, forward terrorist bases inside Israel.

It is not lost on Israelis that the tunnels were reinforced with steel and concrete. The supposed shortage of building materials in Gaza, routinely denounced as cruel by ­Israel’s critics, did not stop Hamas from diverting tens of thousands of tons into preparation for war.

That material could have been used to build houses, hospitals or schools. The tunnels even could have served as bomb shelters to protect Gaza’s civilians from Israeli bombs.

Instead, a determination to kill Jews took precedence over every ­aspect of life in Gaza. That included Hamas leaders urging and sometimes forcing civilians to stay in the line of fire, turning them into human shields to protect rockets and ­ammunition dumps. Nothing better illustrates the Hamas culture of ­hatred and death.

And now that nihilism, endorsed by Gazans who elected Hamas as their government, has destroyed any chance of a sovereign Palestinian state in the near future.

Naturally, much of the world will use a new Israeli hard line to accuse it of genocide and apartheid, blah blah blah. But the facts are clear: Once again, the Palestinians have only themselves to blame.