As Brian mentioned, this is the very question Jesus was asked in Luke 10:25-37. While this site may not be exclusively Christian, Jesus, a Jewish man himself makes a clear illustration and argument as to why this edict applies to all persons and not merely Israelite regardless of whether he was the Messiah or not. In response to the legal expert's question, Jesus intentionally selects the most despised group in the land and seeks to make them the hero of the parable.
Dr. Darrell Bock introduces his commentary on
Jesus' parable this way:
The original impact of the parable of the good Samaritan is generally lost today. After centuries of good biblical public relations, our understanding of a Samaritan as a positive figure is almost a cultural given. But in the original setting, to a Jewish scribe a Samaritan would have been the exact opposite, a notorious “bad guy” and traitor (see discussion on 9:51–56 above). That is an important emotive element to remember as we proceed through this parable. The hero is a bad guy. Culturally he is the last person we would expect to be hailed as an exemplary neighbor.
In fact, the parable turns the whole question around. The lawyer asks who his neighbor is in the hope that some people are not. Jesus replies, “Just be a neighbor whenever you are needed, and realize that neighbors can come from surprising places.”
The story builds on a common situation, a seventeen-mile journey on the Jericho-to-Jerusalem road. This rocky thoroughfare was lined with caves that made good hideouts for robbers and bandits. The road was notoriously dangerous, the ancient equivalent to the inner city late at night. Josephus notes how some took weapons to protect themselves as they traveled this road and others like it. (Jewish Wars 2.8.4 §125).
And Nolland notes,
The traditional enmity between Samaritans and Jews is well captured in m Šeb 8:10: “He that eats the bread of the Samaritans is like one that eats the flesh of swine.”
In fact, the Samaritans were so hated that when Jewish travelers would journey from the Nazareth area of the Galilee region to Jerusalem (in Judea), many Pharisees would take the longer, more circuitous route through Perea
This would add approximately 30 miles to the journey. In fact, in order to take this route, a Pharisee would have to travel the very road on which the story takes place. (It is also interesting then that Jesus just completed this journey and had an altercation with the Samaritans noted in Luke 9:51-55. Jesus was also leaving from Bethsaida [Luke 9:10] which is located on the northwestern most tip of Galilee. This means that it really wasn't any shorter [or longer] to travel through Samaria when departing from Bethsaida.)
Historically, the enmity between the Samaritans and the Jews arose during the Assyrian invasion (721 BC) of the Israelite capital Samaria when some Jews surrendered and were thus not taken into captivity and exiled. During the exile and captivity of the Israelites, the Samaritans began building a new temple on Mount Gerizim in the 5th century BC as the temple and the kingdom of Judea in Jerusalem was inaccessible to the Samaritans at the time, being under the control of King Hezekiah before later falling under Assyrian control (703 BC) (though Judea was later restored at the decline of the Assyrian empire [640 BC]) and then subsequently under Egyptian occupation (609 BC) and Babylonian control (601 BC).
This was wildly offensive to the Jews as God had commanded the temple be built in Jerusalem. Therefore, the Levites had a special tension with the Samaritans as their temple was an affront not just to their religion, but to their livelihoods as well.
As you can see, Jesus' logic makes it clear that Leviticus 19:34 referred not just to individuals, but to neighboring nations as well. So clear and obvious was Jesus analysis of the text that the legal expert was forced to conclude that Samaritans were included as neighbors when Jesus asked him "Which of these three do you think was a neighbor to the man who fell into the hands of robbers?". One can see how distasteful that is to the legal expert who can only bring himself to say "The one who had mercy on him" instead of referring to him as the "Samaritan".
And this is in addition to all of the evidence when we limit ourselves to merely the Old Testament texts as Friedman did - the frequent concern for aliens, the freeing of slaves and even some of those cases unnoticed by Friedman such as the story of Ruth in which an Alien is the heroine of the story and Boaz is celebrated for his compassion on Ruth.
Clearly, both the Old and New testaments want us to conclude that neighbor is corporate and refers not just to those of the same race as Israel, but the neighboring nations as well.