1 And it came to pass in the days of Amraphel, king of Shinar, Arioch king of Ellasar, Chedorlaomer king of Elam, and Tidal king of nations, 2 That these made war with Bera king of Sodom and with Birsha king of Gomorrah, Shinab king of Admah, and Shemeber king of Zeboiim, and the king of Bela, which is Zoar. 3 All these were joined together in the valley of Siddim, which is the Salt Sea. 4 Twelve years they served Chedorlaomer, and in the thirteenth year they rebelled. 5 And in the fourteenth year Chedorlaomer came, and the kings who were with him, and smote the Rephaims in Ashteroth Karnaim, the Zuzims in Ham, the Emins in Shaveh Kiriathaim, 6 And the Horites in the mountains of Seir, to El-paran, which is by the wilderness. 7 And they returned and came to En-mishpat, which is Kadesh, and smote all the country of the Amalekites and also the Amorites, who dwelt in Hazezontamar. 8 And there went out the king of Sodom, the king of Gomorrah, the king of Admah, the king of Zeboiim, and the king of Bela (the same is Zoar), and they joined battle with them in the valley of Siddim, 9 With Chedorlaomer the king of Elam, with Tidal king of nations, Amraphel king of Shinar, and Arioch king of Ellasar—four kings with five. 10 And the valley of Siddim was full of slime-pits. And the kings of Sodom and Gomorrah fled and fell there. And those who remained fled to the mountain. 11 And they took all the goods of Sodom and Gomorrah and all their provisions and went their way. 12 And they took Lot, Abram's brother's son, who dwelt in Sodom, and his goods, and departed.
13 And someone who had escaped came and told Abram the Hebrew. For he dwelt in the plain of Mamre the Amorite, brother of Eshcol, and brother of Aner, and these were confederates with Abram. 14 And when Abram heard that his brother was taken captive, he armed his trained servants, born in his own house, three hundred and eighteen, and pursued them to Dan. 15 And he divided himself against them, he and his servants by night, and smote them and pursued them to Hobah, which is on the left hand of Damascus. 16 And he brought back all the goods. He also brought back his brother Lot and his goods, and also the women and the people.
17 And the king of Sodom went out to meet him after his return from the slaughter of Chedorlaomer, and of the kings who were with him, at the valley of Shaveh, which is the king's dale. 18 And Melchisedek, king of Salem, brought forth bread and wine, and he was the priest of the most high God.
19 And he blessed him and said, "Blessed is Abram of the most high God, possessor of heaven and earth.
20 And blessed be the most high God who has delivered your enemies into your hand." And [Abram] gave him tithes of all.
21 And the king of Sodom said to Abram, "Give me the persons and take the goods for yourself." 22 And Abram said to the king of Sodom, "I have lifted my hand to the LORD, the most high God, the possessor of heaven and earth, 23 That from a thread even to a shoe-latchet I will not take anything that is yours, lest you should say, 'I have made Abram rich,' 24 Except that which the young men have eaten and the portion of the men who went with me: Aner, Eshcol, and Mamre. Let them take their portion."
[v.18] - "Melchisedek" - Reference, Psalm 110:4; Hebrews 5:6-10, 6:19-20, ch. 7.
[v.20] - Text in square brackets added for implied meaning. This clarifies that Abram is the one who gave tithes to Melchisedek. From John Gill's Exposition: "not Melchizedek to Abram, but Abram to Melchizedek, as appears from Hebrews 7:4..."