(Adds background)

ANKARA, Aug 29 (Reuters) - Iran's military detected a U.S. drone entering Iranian airspace on Monday and issued a warning for it to leave, which it subsequently did, Iran's Tasnim news agency reported.

"Iran's army air defence detected and warned an American drone in the eastern airspace of the country. It was coming from Afghanistan. The drone left the area," Tasnim quoted the Iranian military as saying.

Tasnim gave no details on how the Iranian authorities had warned the unmanned drone to leave its airspace.

A U.S. defence official said last week that four of Iran's Islamic Revolutionary Guard Corps (IRGC) vessels "harassed" a U.S. warship on Tuesday near the Strait of Hormuz.

Tehran said the ships had only been carrying out their regular duties monitoring foreign ships near Iranian waters.

(Reporting by Parisa Hafezi; Editing by William Maclean and Toby Chopra) ((william.maclean@thomsonreuters.com ; +97143664253; Reuters Messaging: william.maclean.thomsonreuters.com@reuters.net: Twitter: @WMacleanR))