(CNN) President Donald Trump's travel ban increases the possibility of an attack on America, former CIA Director and US Defense Secretary Leon Panetta told CNN's Christiane Amanpour.

Panetta, who served under President Barack Obama, also said there is "no question" that the ban is based on religion.

"We've fed ISIS a major argument that I think will help them in recruiting and that increases the chances of a potential attack in this country," he warned. "It doesn't lessen that possibility. It increases that possibility."

That argument, he said, is that the West is at war with "Islam" rather than "extremism."

"Any time you ban people from coming into this country from key Muslim nations, there's no question in my mind that that ban is based on religion, and who they are," he said.

Read More