BAGHDAD, August 31, 2018 (Reuters) - Iran has given ballistic missiles to Shi'ite proxies in Iraq and is developing the capacity there to deter attacks on its interests in the Middle East and to give it the means to hit regional foes, Iranian, Iraqi and Western sources said on Friday. Any sign that Iran is preparing a more aggressive missile policy in Iraq will exacerbate tensions between Tehran and Washington, already heightened by US President Donald Trump's decision to pull out of a 2015 nuclear deal with world powers. It would also embarrass France, Germany and the United Kingdom, the three European signatories to the nuclear deal, as they have been trying to salvage the agreement despite new US sanctions against Tehran. According to three Iranian officials, two Iraqi intelligence sources and two Western intelligence sources, Iran has transferred short-range ballistic missiles to allies in Iraq over the last few months. Five of the officials said it was helping those groups to start making their own. "The logic was to have a backup plan if Iran was attacked," one senior Iranian official told Reuters. "The number of missiles is not high, just a couple of dozen, but it can be increased if necessary." Iran has previously said its ballistic missile activities are purely defensive in nature. Iranian officials declined to comment when asked about the latest moves. The Zelzal, Fateh-110 and Zolfaqar missiles in question have ranges of about 200 km to 700 km, putting Saudi Arabia's capital Riyadh or the Israeli city of Tel Aviv within striking distance if the weapons were deployed in southern or western Iraq. The Quds Force, the overseas arm of Iran's powerful Islamic Revolutionary Guard Corps (IRGC), has bases in both those areas. Quds Force commander Qassem Soleimani is overseeing the programme, three of the sources said. Western countries have already accused Iran of transferring missiles and technology to Syria and other allies of Tehran, such as Houthi rebels in Yemen and Lebanon's Hizbollah. Iran's Sunni Muslim Gulf neighbours and its arch-enemy Israel have expressed concerns about Tehran's regional activities, seeing it as a threat to their security. Israeli Prime Minister Benjamin Netanyahu said on Wednesday that anybody who threatened to wipe Israel out "would put themselves in a similar danger". The Western source said the number of missiles was in the 10s and that the transfers were designed to send a warning to the United States and Israel, especially after air raids on Iranian troops in Syria. The United States has a significant military presence in Iraq. "It seems Iran has been turning Iraq into its forward missile base," the Western source said. The Iranian sources and one Iraqi intelligence source said a decision was made some 18 months ago to use militias to produce missiles in Iraq, but activity had ramped up in the last few months, including with the arrival of missile launchers. "We have bases like that in many places and Iraq is one of them. If America attacks us, our friends will attack America's interests and its allies in the region," said a senior IRGC commander who served during the Iran-Iraq war in the 1980s. The Western source and the Iraqi source said the factories being used to develop missiles in Iraq were in al-Zafaraniya, east of Baghdad, and Jurf al-Sakhar, north of Kerbala. One Iranian source said there was also a factory in Iraqi Kurdistan.