By Babak Dehghanpisheh

BEIRUT, Sept 21 (Reuters) - Iran marked the anniversary of its 1980 invasion by Iraq by parading its latest ships and missiles and telling the United States on Wednesday not to meddle in the Gulf.

At a parade in Tehran, shown on state TV, the military displayed a wide array of long-range missiles, tanks, and the Russian-supplied S-300 surface-to-air missile defence system.

At the port of Bandar Abbas on the Gulf, the navy showed off 500 vessels, as well as submarines and helicopters, at a time of high tension with the United States in the strategic waterway.

U.S. officials say there have been more than 30 close encounters between U.S. and Iranian vessels in the Gulf so far this year, over twice as many as in the same period of 2015.

On Sept. 4, a U.S. Navy coastal patrol ship changed course after an Iranian Revolutionary Guard fast-attack craft came within 100 yards (91 meters) of it in the central Gulf, at least the fourth such incident in less than a month, U.S. Defense Department officials said.

"We tell the Americans that it's better that the capital and wealth of the American people should not be wasted on their inappropriate and detrimental presence in the Persian Gulf," said Major General Mohammad Ali Jafari, commander of the Islamic Revolutionary Guard Corps.

The Tasnim news site quoted him as saying: "If they want to extend their reach and engage in adventurism they should go to the Bay of Pigs" - a reference to the location of a botched U.S. attempt to overthrow Cuban leader Fidel Castro in 1961.

In Tehran, the Chief of Staff of the Iranian Armed Forces, Major General Mohammad Hossein Baqeri, declared that Iran wanted peace. But he also said Iran's lessons in the 1980-88 war against Iraq now served as a guide for "our brothers in faith" in Syria, Palestine, Lebanon, Iraq, Afghanistan, Yemen and Bahrain, a checklist of countries where Iran has political, religious or military allies.

In a reference to Iran's arch-foe Israel, a banner on one military truck shown on state TV read,: "If the leaders of the Zionist regime make a mistake then the Islamic Republic will turn Tel Aviv and Haifa to dust."

The Russian-supplied missile defence system on show in Tehran was deployed last month around Iran's underground uranium enrichment facility at Fordow. Enrichment at the site, around 100 km (60 miles) south of Tehran, has stopped since the implementation in January of Iran's agreement with world powers to curb its nuclear programme in exchange for an easing of sanctions.

Also on display was the Qadr H missile, which has a range of 2,000 km, according to state TV. Iran's ballistic missile programme has been criticised by the West, and the U.S. Treasury imposed sanctions on two Iranian companies in March because of their alleged ties to it.

(Reporting by Babak Dehghanpisheh; Editing by Mark Trevelyan) ((babak.dehghanpisheh@thomsonreuters.com;))