Short answer
Yes. Muslims can have non-Muslim friends, neighbours, colleagues and classmates, and should treat them with kindness and justice. What the Quran forbids is taking them as allies against Muslims or taking on their religion. Choose close friends who help your faith, whatever their background.
Good relations, kindness, business, gifts and friendship in worldly matters with non-Muslims who are not hostile are permitted. Muwalat, meaning deep heartfelt attachment and the loyalty kept for fellow believers, or love of their disbelief, is haram. All four schools agree in principle.
The four schools agree on this.
Explanation
The Quran says Allah does not forbid you from being righteous and just toward those who do not fight you because of your religion. The Prophet ﷺ had a Jewish boy serving him, did business with Jewish merchants, accepted gifts from non-Muslims and visited them when they were sick.
Verse 5:51, often translated "do not take the Jews and Christians as allies", uses the word awliya, meaning patrons and allies. The scholars of tafsir explain it as political and religious alliance against the Muslim community, especially in wartime, not ordinary friendship, kindness or work relationships. Read with 60:8, the picture is balanced: be good to all people, and do not give your religious loyalty to anyone above Allah. The four schools agree on this distinction.
- Fine: studying together, sports, work friendships, sharing meals (halal food), helping each other, gifts.
- Careful: close friends shape your habits. The Prophet ﷺ said a person follows the way of their close friend, so let your best friends be people who help you pray and stay away from haram, Muslim or not.
- Avoid: joining their religious rites, or going along with haram such as drinking to fit in.
Friendship is also how most people first learn what Islam really is. See neighbours in Islam and Quran 60:8.
The evidence
Quran, Surah Al-Mumtahana 60:8
لَّا يَنْهَىٰكُمُ ٱللَّهُ عَنِ ٱلَّذِينَ لَمْ يُقَٰتِلُوكُمْ فِى ٱلدِّينِ وَلَمْ يُخْرِجُوكُم مِّن دِيَٰرِكُمْ أَن تَبَرُّوهُمْ وَتُقْسِطُوٓا۟ إِلَيْهِمْ ۚ إِنَّ ٱللَّهَ يُحِبُّ ٱلْمُقْسِطِينَ ﴿٨﴾
Allah does not forbid you from those who do not fight you because of religion and do not expel you from your homes - from being righteous toward them and acting justly toward them. Indeed, Allah loves those who act justly.
Kindness and justice toward peaceful non-Muslims are allowed and loved.
Quran, Surah Al-Maaida 5:51
۞ يَٰٓأَيُّهَا ٱلَّذِينَ ءَامَنُوا۟ لَا تَتَّخِذُوا۟ ٱلْيَهُودَ وَٱلنَّصَٰرَىٰٓ أَوْلِيَآءَ ۘ بَعْضُهُمْ أَوْلِيَآءُ بَعْضٍۢ ۚ وَمَن يَتَوَلَّهُم مِّنكُمْ فَإِنَّهُۥ مِنْهُمْ ۗ إِنَّ ٱللَّهَ لَا يَهْدِى ٱلْقَوْمَ ٱلظَّٰلِمِينَ ﴿٥١﴾
O you who have believed, do not take the Jews and the Christians as allies. They are [in fact] allies of one another. And whoever is an ally to them among you - then indeed, he is [one] of them. Indeed, Allah guides not the wrongdoing people.
The prohibition is on alliance and religious loyalty, as the scholars explain.
Jami' at-Tirmidhi 2378
Graded hasan... الرجل على دين خليله فلينظر أحدكم من يخالل ...
"A man follows the way of his close friend, so let each of you look at whom he befriends."
Close friends influence your faith, so choose them carefully.
Sahih al-Bukhari 1356
Sahih... الحمد لله الذي أنقذه من النار ...
"Praise be to Allah who saved him from the Fire."
The Prophet ﷺ had a Jewish boy in his service and visited him when sick.
Where the ruling is recorded
- Ma'arif al-Quran (Mufti Muhammad Shafi), commentary on Surah Al Imran 3:28. Distinguishes forbidden muwalat from permitted good relations, kindness and dealings.
This answer is pending review by the scholars on our team. Quran translation by Sahih International. Hadith Arabic from the standard editions of the six books and the Muwatta, with gradings as recorded there; the English is our own rendering. Spotted a mistake? Tell us.