Anṣār (Arabic: الأنصار, helpers) or Anṣār al-Nabī (s) (Arabic: أنصار النبی, helpers of the Prophet (s)) were Muslims in Medina from Aws and Khazraj clans who allied with the Prophet Muhammad (s) before his migration or Hijra, and after his migration to Medina they helped him and the Muhajirun (Muslims who migrated from Mecca to Medina). They were highly respected by Imam 'Ali (a) during his caliphate, and they always supported him.
The word "anṣār" is the plural form of "naṣīr" and "nāṣir" from the root "n-ṣ-r" which means helper. It was first used literally for Muslims of Medina from Aws and Khazraj clans who helped Muhajirun, but soon it turned into a terminology referring to Muslims who allied with the Prophet (s). It is not obvious exactly when the term was used for Muslims of Medina, but according to a hadith from Anas b. Malik, the terms "Muhajirun" and "Ansar" were first used in the Qur'an. And according to a hadith from Ibn Athir, the Prophet (s) was the first person who used the word for Muslims of Medina.
In the Qur'an
In two verses, 100 and 117, of Qur'an 9, the terms "Muhajirun" and "Ansar" are used in conjunction with one another. Other than this case, the word "Ansar" is used in the Qur'an 61:14 for the companions of Jesus (a).