By Frank Pingue

Feb 17 (Reuters) - Iran defeated the United States to take the gold medal in wrestling's World Cup on Friday, winning a match that politics almost prevented.

Olympic silver medallist Komeil Ghasemi beat American Nick Gwiazdowski 5-0, giving Iran a 5-3 win in the gold medal final. After the match, they politely shook hands in front of a rowdy crowd in the western Iranian city of Kermanshah.

Ghasemi then held an Iranian flag above his head before placing it in the centre of the mat, dropping to his knees and planting his face on the flag.

The two countries have a friendly relationship in wrestling, but that was put to the test in recent weeks. Iran said it would stop American citizens from entering the country, in retaliation for "hostile policies" of the U.S. government.

Those policies were U.S. President Donald Trump's executive orders barring travelers from seven Muslim-majority countries, including Iran, from entering the United States. But federal courts blocked Trump's ban, allowing Iran to lift its reciprocal ban and the American team to travel to the World Cup.

USA Wrestling sent the first American sports team to compete in Iran in nearly 20 years in 1998, when freestyle wrestlers competed in the Takhti Cup in Tehran.

American wrestlers have competed in Iran for the Takhti Cup nine times, while USA Wrestling said it has hosted teams from Iran in the United States 16 times since the 1990s.

(Reporting by Frank Pingue in Toronto, editing by Larry King) ((frank.pingue@thomsonreuters.com; +1-416-941-8094; Reuters Messaging: frank.pingue.thomsonreuters.com@reuters.net))