When Prophet Muḥammad (Peace be upon him) was divinely sent, he found that it was a common practice for people to be bad neighbors. Everybody used to wrong their neighbor and treat him badly. Moreover, people did not see that this behavior was a fault or a blemish to one's character. Ja’far ibn abu Talib- the cousin of Prophet Muḥammad (Peace be upon him) – described briefly the then common practice while talking to Negus, King of Ethiopia, as saying: ‘We were a nation of ignorance and evil. We used to break our family ties and treat neighbors badly”. 
Therefore, a neighbor did not feel safe from his neighbor’s evil, but rather expected evil from his neighbor at anytime. So, the Prophet (Peace be upon him) came and raised the value of being a good neighbor, giving the neighbor more rights that helped secure the community and establish the rules of love, security, safety, and co-operation among people.
Accordingly, he declared that his message was not only a devotional message to reform the religion; but it was also a call to rectify life, the larger community, and all types of treatment as well. Hence, it is a message to reform all aspects of life. Prophet Mohammad (Peace be upon him) was the first one to enforce these rights and duties in order to lead by example.
The rights of neighbors in the message of Muhammad (Peace be upon him):
The Qur’an came to confirm the rights of neighbors and recommend Muslims to treat them justly. Allah the Almighty says, “Serve Allah, and join not any partners with Him; and do good- to parents, kinsfolk, orphans, those in need, neighbors who are near, neighbors who are strangers, the companion by your side, the wayfarer (you meet), (Al-Nisaa’, 4: 36).
Commenting on this verse, Ibn Kathir said, “The word al-Jar dhi al-Qurba means the neighbor who is also a relative, and the words al-jar al-Junub means the neighbor who is not a relative. Some scholars are reported to have said, “The words al-Jar dhi al-Qurba mean the Muslim neighbor and the words al-jar al-Junub stand for the non-Muslim neighbor and both opinions recommend the good treatment of neighbors.
Due to their enforceable rights, there are many prophetic traditions that command kind treatment to neighbors. Because of the repeated recommendations by Angel Gabriel on neighbors, the Prophet (Peace be upon him) thought that the neighbor would be given a share of inheritance and be considered family member. On the authority of ‘Abd Allah ibn ‘Umar said, Allah’s Messenger (Peace be upon him) said, “Gabriel kept reminding of neighbors' rights that I thought he would order me to take them for heirs”. 
The phrase (kept reminding me) means that every time he met the Prophet (Peace be upon him) and wanted to leave, he reminded him of neighbors' rights. Furthermore, he stressed on this point and reminded him to treat neighbors justly. Due to the repeated enjoinments, the Prophet (Peace be upon him) thought that Allah the Almighty would give him a rightful share in his neighbor’s money.
Islam told mankind that the best Muslim is the one who is best to his neighbors. On the authority of ‘Abd Allah ibn ‘Amr ibn al-‘As who said that Allah’s Messenger said, “The best of companions with Allah is the one who is best to his companion, and the best of neighbors with Him is the one who is best to his neighbor”. 
The Prophet (Peace be upon him) told us that the ugliest and worst type of sin is to deal with neighbors badly and to betray the right of neighborhood. This is because it is the duty of the neighbor to be honest concerning his neighbor’s money, honor, and dignity. Hence, if there is a defect in one's neighbor, this is considered a matter of breach and violation that Allah would not forgive due to betrayal and harm inherent therein. On the authority of Al-Miqdad ibn ‘Amr said that one day while Allah’s Messenger (Peace be upon him) was talking to his Companions, he said to them, “What would you say about adultery? They said, “It is prohibited until the Day of Judgment, Allah and His Messenger (Peace be upon him) made it prohibited”. Allah’s Messenger (Peace be upon him) said, “To commit adultery ten times is a lesser sin than doing this crime to your neighbor’s wife”. Then he said, “What would say about theft?” They said, “It is prohibited until the Day of Judgment, Allah and His Messenger (Peace be upon him) made it so”. He said to steal ten times is lesser in sin than stealing your neighbor’s home”. 
Furthermore, on the authority of ‘Abd Allah ibn Mas’ud who said, “O Messenger of Allah, which sin is most grievous? He said, “To set up a rival with Allah, though He (Alone) created you." I said, "What next?" He said, "To kill your son lest they should share your food." I said, "What next?" He said, "To commit adultery with the wife of your neighbor."
In another occasion his wife ‘Aisha asked him saying, “O Allah's Messenger! I have two neighbors and would like to know to which of them I should give presents." He replied, "To the one whose door is nearer to you." Also, he referred to the importance of a neighbor smiling to his neighbor, and sharing his food by saying, “Don't consider anything insignificant out of good things even if it is that you meet your brother with a cheerful countenance”.  The Prophet also said, “O Abu Dharr, if you cook soup, make a lot of it and give your neighbors”. 
Muhammad (Peace be upon him) taught that a neighbor has a right that his close neighbor should fulfill, i.e. sharing with him in good and bad times, and feeding him from what he eats even if it was soup. This is to make him feel his position and importance without wounding his pride or causing him injustice. In addition, being a good neighbor is to keep one's neighbor's family and children safe when absent, offering services to them, taking care of their needs, protecting them and ensuring that the elder ones do not violate the rights of the younger.
So, he (Peace be upon him) enjoins a Muslim to love his neighbor, respect him, treat him fairly, show him kindness whenever and however possible, visit him if ill, console him, serve him, help him if necessary, love goodness for him and lower his gaze if he sees anything that is illegal to look at. He (Peace be upon him) said, “Four things are part of happiness: a righteous wife, a spacious abode, a good neighbor and a comfortable mount. And four things are part of misery: a bad wife, a bad neighbor, a bad mount and a small abode”. 
The Prophet (Peace be upon him) was eager to confirm, assert and establish the special practical treatment of neighbors. This is in order to implement the theoretical meanings, which he announced and confirmed. For example, he assures preventing harm in a practical way. Neighbors know each other's private affairs and it is likely that they will hear something that no one else knows except you. Accordingly, the neighbor could make use of this to cause harm and doing so would be worse than if anyone else did this because you know how to hurt him and what would injure him the most. He (Peace be upon him) even linked soundness of faith to removing harm from the neighbor, he said, “He who believes in Allah and the Last Day should not cause harm to his neighbor”. 
Abu Hurairah (may Allah be pleased with him) narrates, “A man said: O Messenger of Allah, “So and so (a woman) – and he spoke of how much she prayed and fasted and gave charity – but she annoys her neighbors with her (sharp) tongue.” He said: “She will be in Hell.” He said: “O Messenger of Allah, So and so (another woman) – and he spoke of how little she fasted and gave charity and prayed – but she gives cheese in charity and she does not annoy her neighbors with her (sharp) tongue.” He said: “She will be in Paradise.”  Furthermore, Abu Hurairah reported that Allah’s Messenger (Peace be upon him) said, “He will not enter Paradise from whose harm his neighbor is not safe”. 
On the other hand, the Prophet (Peace be upon him) guided us to the point that when the neighbor asks his neighbor’s permission to use something of what Allah has given him, he should allow him to do so. He says, “'No one should prevent his neighbor from fixing a wooden peg in his wall". This is because the neighbor may need or be obliged to have his home more spacious for the welfare of his family and this means he may have to do something in your home. So, if he needed this, you should give him permission to do so with love and dignity as Allah helps the one who helps his brother.
When it comes to neighbors giving to each other, they know one another more than anyone else. A person might be deceived because of someone's appearance; however, a neighbor cannot be deceived because he knows his neighbor's status very well. So, if your neighbor needs money you have to give some to him because of what Allah the Almighty has given to you. Apart from being poor, he has the further right of being your neighbor. He should be given priority over someone who is poor and faraway. If he asked you for a loan and you have money, you have to give to him, as the Messenger of Allah (Peace be upon him) said, “He has not believed in me who sleeps satisfied while his neighbor is hungry while he is beside him and knows about hungriness”.
Thus, the greatest meanings of loyalty, co-operation, and taking care of others living with us are shown here. The Prophet (Peace be upon him) implanted these meanings in his Companions, and he (Peace be upon him) was the best and the greatest to his neighbors.
 Reported by Ahmad (3/108) and authenticated by Al-Albani in his book titled as-Selselah as-Sahihah..
 Tafsir Ibn Kathir I/424.
 An agreed upon prophetic tradition.
 Reported by At-Termidhi (no. 1944) and authenticated by Al-Albani.
 Reported by Aḥmad (no. 23342) and authenticated by Al-Albani
 An agreed upon prophetic tradition
 Reported by Al-Bukhari (No. 2259)
 Reported by Muslim (No. 6857)
 Reported by Muslim (No. 2625)
 Reported by Ibn Ḥibban in his sound collection (No. 4032) and authenticated by Al-Albani
 An agreed upon prophetic tradition
 Reported by Aḥmad (No. 9383) and authenticated by Al-Albani
 Reported by Muslim (No. 46)
 An agreed upon prophetic tradition
 Reported by At-Tabarani in his book titled al-Mu’jam al-Kabir (No. 751) and authenticated by Al-Albani