Speaking at a high-level security conference in Aspen, Colorado, outgoing US Defense Intelligence Agency head Michael Flynn warned against the dangers of toppling Hamas, saying what may replace the Islamist group could be even worse.

“If Hamas were destroyed and gone, we would probably end up with something much worse. The region would end up with something much worse,” Flynn, a lieutenant general, told the conference Saturday, according to Reuters.

He warned that with Hamas out of the picture, the Islamic State, or something like the brutal Islamist group ruling over parts of Syria and Iraq, could take its place.

Flynn also said that he was pessimistic about the Middle East’s future. “Is there going to be a peace in the Middle East? Not in my lifetime,” he said.

In June, Egypt arrested 15 men it said belonged to the Islamic State as they crossed from Rafah into the Sinai Peninsula. In addition, videos have emerged on YouTube showing masked men pledging allegiance to IS and firing rockets at Israel.

Hamas denies the presence of IS members in the Gaza Strip.

The number of Palestinians killed reached 1,047 in 19 days of fighting, while more than 6,000 wounded, Hamas health officials said; hundreds of Hamas gunmen are among the dead. Forty-three Israeli soldiers and three civilians have been killed. Hamas has fired over 2,000 rockets into Israel, and attempted five attacks through cross-border tunnels, killing six IDF soldiers.