<P> United States foreign policy in the Middle East has its roots as early as the Barbary Wars in the first years of the U.S.'s existence, but became much more expansive after World War II . American policy during the Cold War tried to prevent Soviet Union influence by supporting anti-communist regimes and backing Israel against Soviet - sponsored Arab countries . The U.S. also came to replace the United Kingdom as the main security patron of the Persian Gulf states in the 1960s and 1970s, working to ensure a stable flow of Gulf oil . Since the 9 / 11 attacks of 2001, U.S. policy has included an emphasis on counter-terrorism . The U.S. has diplomatic relations with all countries in the Middle East except for Iran, whose 1979 revolution brought to power a staunchly anti-American regime . </P> <P> Recent priorities of the U.S. government in the Middle East have included resolving the Arab--Israeli conflict and limiting the spread of weapons of mass destruction among regional states . </P>

How long has america been at war in the middle east
find me the text answering this question