you don't need to go into hypotheticals in order to find a similar situation.
not too long ago, the USA invaded not one - but three countries - and toppled their regime under the pretense of removing a extremist/fundamentalist dictator/regime/organization
1) Saddam Hussein in Iraq
2) Taliban in Afghanistan
3) Muamar Qaddafi in Libya
(side note, i'm still waiting for the 4th - Bashar Assad in Syria)
all those regimes were the recognized rulers of their country in some form (elected, appointed, inherited) and all were removed from power, while causing the death of thousands of civilians, with the blessing of the international community. but Israel engages a usurping terrorist organization, in self defense, on a piece of land that is not even a country and gets condemned left and right (although i admit this time around the world leaders lean more towards israel's side).