In his wide-ranging interview with The New York Times, Republican presidential nominee Donald J. Trump stressed the importance of fighting ISIS while declaring “we are going to take care of this country first before we worry about everybody else in the world.” For counterterrorism (and I would argue for security in general), such thinking is dangerously wrong-headed: Fighting ISIS and stopping other foreign terrorist threats to the U.S. homeland requires close alliances and deep engagement abroad.

Allies may also have better access to a terrorist stronghold due to geography or historic ties. Saudi Arabia, Turkey, and Jordan are within easy bombing range of ISIS’ core: the U.S. homeland is not. Although military action against ISIS’ core in Iraq and Syria is vital, it is often quiet global intelligence cooperation that does much of the day-to-day counterterrorism lifting. Given the geographic span of ISIS operations, it is not realistic for the United States to have strong unilateral capabilities in every possible country where the terrorists might operate and use as a base for anti-U.S. operations. Foreign governments fill this gap, acting as a force multiplier for the United States. Shortly after 9/11, the United States was working with over 100 countries on counterterrorism; several years into the war on terror a senior CIA official testified that virtually every capture or killing of a suspected terrorist outside Iraq involved at least some help from a foreign intelligence service.

Many allies have skilled intelligence services, and they also use their police and their domestic intelligence services to gather information. These services of course know local languages and are culturally aware. They can also take advantage of the law in their efforts to disrupt terrorism: Terrorism, after all, is a crime. Allies, particularly less savory ones, use a government’s coercive power as well. Although people automatically think torture, governments at times threaten to jail a relative of a suspected terrorist or withhold a business permit or the right to attend university. These seemingly mundane threats are something that the United States cannot do outside its own borders.

Many of the most basic homeland security tasks do not begin or end with the homeland.

Given these advantages, the primary role of U.S. intelligence is to cajole and strengthen allies, not replace them. The United States might provide technical assistance, as many U.S. allies are far weaker in this area. In addition, U.S. intelligence often acts as a conductor of global liaison services. In 2010, al-Qaida of the Arabian Peninsula tried to bomb two cargo planes as they approached the United States. Efforts to disrupt the plot involved not only the United States and Yemen, but also the countries in transit, including Qatar, the United Arab Emirates, Germany, and the United Kingdom. And Saudi Arabia provided a key intelligence tip.

Many of the most basic homeland security tasks do not begin or end with the homeland. Foreign governments provide information on terrorist suspects, and there is considerable cooperation on those who might travel to the United States. Much of the screening to hinder terrorist travel and operations is done “over there,” not in the United States.

Our world is too small, and terrorists too global, to think of U.S. security narrowly. If we want to fight ISIS and other foes, we need allies. That doesn’t mean we should do whatever our allies want or support them unconditionally. But we must recognize that if we expect them to help America fight its enemies, we must stand by them as well.