"A case in point is Pakistan's use of extremist groups as an instrument of foreign policy is well documented...," he said while addressing the third Counter Terrorism Conference organised by India Foundation.
Mr Ansari said the availability of financial resources is critical to the success of these extremist groups as misplaced sense of charity, or religious duty, on the part of citizens contributes to it.
"Linked to it is the misuse of institutions intended to impart faith-based education. Instances of it abound in Pakistan and Bangladesh and also in other countries of the Indian Ocean littoral.
"These misinterpret religious texts to induce intolerance which, in turn, promotes a narrow and bigoted approach that is conducive to use of violence," he said.
Mr Ansari said essentially, the Pakistani military has reared "good" terrorists for cross-border missions while battling "bad" militants that fail to toe its line.
He also said that the powers which created conditions for the rise of ISIS are the same which are claiming to be its victim.
"In recent times, the rise of ISIS or Daesh in Syria-Iraq has caught the attention of the world. Yet, even a cursory study of the factors that led to the rapid rise of such dangerous forces reveals that the very actors, who now claim to be threatened by it, have been responsible for creating the conditions--directly or indirectly--that led to its rise," he said.