The remarks were greeted by chants of "Death to America" at a ceremony in Tehran marking the end of the Muslim fasting month of Ramadan, which was broadcast live on state television.
Khamenei also said Tuesday's nuclear agreement would not alter Iran's support for the governments of Syria and Iraq nor its backing of "oppressed people" in Yemen and Bahrain, and the Palestinians.
The supreme leader's comments reflected his longstanding position that Iran's engagement with the six powers was solely to reach a nuclear deal that was in its national interest.