Iran has threatened to close the Strait of Gibraltar and the Mediterranean Sea unless Israel stops bombing Gaza, as the US warned Tehran was “deeply involved” in attacks on shipping.