Jabir reported: The Messenger of Allah, peace and blessings be upon him, said:
أُمِرْتُ أَنْ أُقَاتِلَ النَّاسَ حَتَّى يَقُولُوا لَا إِلَهَ إِلَّا اللَّهُ فَإِذَا قَالُوا لَا إِلَهَ إِلَّا اللَّهُ عَصَمُوا مِنِّي دِمَاءَهُمْ وَأَمْوَالَهُمْ إِلَّا بِحَقِّهَا وَحِسَابُهُمْ عَلَى اللَّهِ
I have been commanded to fight the people [those who wage war on Islam] until they say there is no God but Allah. So when they say there is no God but Allah then they will be granted protection from me for their lives and property, except by right of justice, and their reckoning is with Allah.
Then the Prophet recited the verse:
إِنَّمَا أَنْتَ مُذَكِّرٌ لَسْتَ عَلَيْهِمْ بِمُصَيْطِرٍ
Verily, you are only a reminder. You are not over them as a dictator. (88:22)
Source: Sahih Muslim 21, Grade: Sahih
Ibn Taymiyah comments on this tradition, saying:
مُرَادُهُ قِتَالُ الْمُحَارِبِينَ الَّذِينَ أَذِنَ اللَّهُ فِي قِتَالِهِمْ لَمْ يُرِدْ قِتَالَ الْمُعَاهَدِينَ الَّذِينَ أَمَرَ اللَّهُ بِوَفَاءِ عَهْدِهِمْ
The meaning of this tradition is to fight those who are waging war whom Allah has called us to fight, and it does not mean to fight those who have made peace with whom Allah has commanded us to fulfil their peace.
Source: Majmu’ Al-Fatawa 19/20
Ibn Rajab comments on this tradition, saying:
وَالْمَعْنَى إِنَّمَا عَلَيْكَ تَذْكِيرُهُمْ بِاللَّهِ وَدَعْوَتُهُمْ إِلَيْهِ وَلَسْتَ مُسَلَّطًا عَلَى إِدْخَالِ الْإِيمَانِ فِي قُلُوبِهِمْ قَهْرًا وَلَا مُكَلَّفًا بِذَلِكَ
The meaning is that your duty is only to remind them about Allah and to preach to them. You do not have authority to enter faith into their hearts by force and you are not responsible for that.
Source: Jami’ Ulum wal-Hikam 8
According to an opinion, the 'people' here refer to those who wage war on Islam (as mentioned above from Ibn Taymiyyah R.A). This is consistent with the verse from the Quran: "Fight in the way of Allah those who fight you but do not transgress. Indeed. Allah does not like transgressors." (Quran 2:190)