In Gal. 5:14, Paul cites the Old Testament as support for his argument. The Greek text of Gal. 5:14 is as follows: Galatians 5:14 ὁ γὰρ πᾶς νόμος ἐν ἑνὶ λόγῳ πεπλήρωται, ἐν τῷ Ἀγαπήσεις τὸν πλησίον σου ὡς σεαυτόν. The quotation, Ἀγαπήσεις τὸν πλησίον σου ὡς σεαυτόν, comes directly from the LXX of Lev. 19:18, which reads as follows: Leviticus 19:18 καὶ οὐκ ἐκδικᾶταί σου ἡ χείρ, καὶ οὐ μηνιεῖς τοῖς υἱοῖς τοῦ λαοῦ σου καὶ ἀγαπήσεις τὸν πλησίον σου ὡς σεαυτόν, ἐγώ εἰμι κύριος. This quotation is also used by Jesus (Matt. 5:43; 19:19; 22:39; Mark 12:31, 33; Luke 10:27), and James (James 2:8) although in Matt. 5:43, Jesus quotes it in an unfavorable light referring, not to the Old Testament usage, but to the way the text had been twisted by his contemporaries.
In Leviticus, the quotation, “you shall love your neighbor as yourself,” is part of a chapter in the longer final section of Leviticus which addresses consideration for practical holiness for the nation of Israel. Chapter 19 is a seeming hodge-podge of commands and exhortations given in several sections which appear to be disconnected from one another. The second section of exhortations (Lev. 19:12-18) concerns one’s treatment for his neighbor. Honesty is enjoined and exploitation of the weak and powerless is forbidden. The section ends with v. 18, which contains the exhortation quoted by Jesus, Paul, and James.
The words used in the Lev. 19:18 are generic words which are “as wide-ranging in their scope and meaning in Hebrew as the corresponding English terms.”  The word “love,” then, may be used to cover a wide range of behaviors and the word “neighbor” is not very restrictive. The Israelites then could do many things to demonstrate love and they could do them to many people, not just fellow members of the covenant community. Thus it seems that Paul and Jesus and James are all correctly using the quotation in the sense that they not only correctly cite the wording of the Old Testament passage but also use it in the spirit in which it was originally intended in the context in which it was given. They point to this expression as the summation of all of the believer’s responsibility to his fellow human beings. 
In Gal. 5:14, Paul’s use of this verse is a little surprising given the context. Paul has spent most of the epistle explaining that he “died to the law” (2:19), that righteousness does not come by the law (2:21), that the Spirit is not received through the keeping of the law (3:2, 5), that the sons of Abraham are not identified by the keeping of the law (3:6-7), that the law beings a curse (3:10), that the law cannot justify one before God (3:11-12), that the inheritance of God’s promises is not through the law (3:18), that the law cannot bring true righteousness (3:21), that the law only existed to guard us until Christ came (3:22-25), and that those who are under the law are in bondage (4:25). Why the does Paul now point the believer to the law and to seek its fulfillment in it?
Paul is not pointing to the observance of this law is a means to appease God or to earn God’s blessing and the previous portions of this epistle demonstrate that clearly. Paul is, however, pointing to the law not only as a genuine concern for the Christian’s life but also as a working out of the grace the believer has received.
Paul indicates that this principle, Ἀγαπήσεις τὸν πλησίον σου ὡς σεαυτόν, is the “fulfilling,” πεπλήρωται, (perfect passive indicative of πληρόω) of the law. If used in the sense of “summed up” (as in NIV and NET Bible) then Paul is saying that the whole law is summarized in this saying. While this certainly is the manner in which Lev.19:18 is used by Jesus in Matt. 22:39, here it seems that Paul is referring to this law of love as more than a mere summation because in Gal. 5 he is speaking of the proper manner of living out one’s liberty in Christ. Indeed, in the previous sentence, Paul speaks of serving one another through love. It seems, then, that Paul is instead using πεπλήρωται in the sense of “fulfilled” (as in KJV, NKJV, NASB, and ESV) and so is saying that the grace of God which brings the Spirit to the believer and which works spiritual transformation in him, is properly worked out in the law of love. The broader semantic domains of “love” and “neighbor” in the Hebrew of Lev. 19:18 expand the responsibility of the believer beyond the mere keeping of a set of precepts, which would, in turn, place one once again under bondage.
So Paul uses Lev. 19:18 in a manner consistent with its Old Testament context, while at the same time, bringing it into the light of the New Covenant. He holds it forth not as a means of attaining favor with God, but as a natural outworking of the favor and grace of God the believer already has.
 Gordon J. Wenham, Leviticus NICOT (Grand Rapids: Eerdmans, 1979), 269.
 See especially Matt. 22:36-40 for a clear example of this where in v. 40 Jesus draws this conclusion.