For reference, my Hebrew (MT) translation:
(13) And now, Joshua was by Jericho, and he lifted his eyes and he saw – (and) behold! - a man standing in front of him, and his drawn sword [was] in his hand. And Joshua walked to him, and he said to him, “Are you with us, or with our adversaries?”
(14) And he said, “No, for I am a prince/commander of the army of the Lord , now I have come [ I came].” And Joshua fell upon his face to the ground and he worshiped [or bowed down]. And he said to him, “What does my Lord command his servant?”
(15) And the commander of the army of the Lord said to Joshua, “Loosen your sandal from upon your foot, for the place which you are standing upon [it], it is holy.” And Joshua did thus.
My Greek (LXX) translation:
(13) And so it happened like [this], Joshua [or Jesus] was in Jericho and having looked up with the eyes [of him, in A], he saw a person standing opposite him who had drawn the sword in his hand. And drawing near, Joshua [Jesus] said to him, “are you our people or of the opponent?”
(14) But the one said to him, “I am (the) chief commander of the armies [powers] of the Lord, Now I have come.” And Joshua [Jesus] fell down on [his] face to the earth, and he said to him, “Master, what do you command your domestic servant?”
(15) And the chief-commander of the Lord said to Joshua [Jesus],” Loosen the sandals from your feet; for the place on which you are stood is holy.”
The NRSV Translation:
13 Now when Joshua was near Jericho, he looked up and saw a manstanding in front of him with a drawn sword in his hand. Joshua went up to him and asked, “Are you for us or for our enemies?”
14 “Neither,” he replied, “but as commander of the army of the Lord I have now come.” Then Joshua fell facedown to the ground in reverence, and asked him, “What message does my Lord have for his servant?”
15 The commander of the Lord’s army replied, “Take off your sandals, for the place where you are standing is holy.” And Joshua did so.
The Commander of the Lord’s Army in Joshua 5:13-15
The conquest of the land of Canaan is a key theme of the Book of Joshua. Joshua 5:13-15 is presented as a hinge point as a wandering people become an established nation through the power of the Lord; the passage intentionally recalls Moses’ commission at the burning bush (Ex 3) while also anticipating the Lord’s victories in the following passages.
Josh 5:13-15 is usually understood as an independent unit within the wider structure of Josh 5-6; it follows accounts of circumcision (Josh 5:2-9) and Passover celebration (Josh 5:10-12), and is followed by the conquest of Jericho (Josh 6). However, following Marcus’s prompt ‘to take alternate chapter divisions into account’, it is worth noting that the Masoretic Text (MT) has a closed paragraph division (signified by ס) after Josh 5:12 but the following division (also closed) is after Josh 6:1. This alternate unit highlights the problem of understanding in what sense Joshua was ‘in Jericho’ (v. 13) since Jericho was ‘certainly shut up’ (Josh 6:1) at that time; such a sealing off is evidently no barrier to the armies of the Lord.
Although the Septuagint (LXX) version of the narrative is slightly shorter, both versions serve the same purpose of confirming that the Lord will conquer Jericho for Israel. We will address relevant points of difference in the following section.
Verse by Verse Commentary
v. 13: The location of this event is recorded as ביריחו in the Masoretic Text and the Septuagint has εν Ιεριχω. The NRSV translates this as ‘by Jericho’. The Hebrew preposition ב usually means ‘in’ although it can also denote proximity (e.g. by or with) but this is ‘not very common’. Within the narrative flow of chapters 5 and 6 the phrase ‘by Jericho’ fits naturally, however a reading of ‘in Jericho’ is the more literal reading in both the MT and LXX. An event inside Jericho would suggest either that this narrates an event that took place chronologically later (i.e. after Jericho had been conquered), or that the event was a prophetic vision like Ezekiel’s vision of the temple (cf. Ezek 8). Römer notes that in its present form chapter 5 mirrors ‘in an almost concentric way…the beginning of the Moses story’, moving from river crossing (Josh 3-4, cf. Ex 14) to circumcision (Josh 5:2-9, cf. Ex 12:43-50) to Passover celebration (Josh 5:10-12, cf. Ex 12:1-28) to divine revelation (Josh 5:13-15, cf. Ex 3). To maintain this close literary link to Exodus in this section of the book, the location of this passage in the Book of Joshua must be retained, and so this passage should not be read as an achromatically placed free-standing unit.
The commander has a drawn sword in his hand. This expression raises the dramatic tension of the encounter by presenting the being as a probable adversary to Joshua; on other occasions when this expression is used (Num 22:23, 31; 1 Chr 21:16) the envoy is a threat to the recipient of the vision rather than the recipient’s adversaries. The identity of the man as an angelic figure is perhaps hinted at in the LXX through use of the slightly less common term ρομφαια (rather than μαχαιραν) which has connotations of the ρομφαιν in Genesis 3:24. This sword (ρομφαια) is further held in contrast to the flint knives (μαχαιρας πετριωας εκ πετρας) used in the circumcision ritual (Josh 5:2). Römer argues that as ‘the texts never explain how Joshua got his sword [which Joshua uses in Josh 8, 10, and 11], the best hypothesis might indeed be to imagine he received the divine sword after the encounter related in Josh 5:13-15’. The provided sword then becomes one means by which the Lord is said to fight for Israel.
‘And Joshua walked to him’ – here Joshua appears in the role of a sentry and must demonstrate the virtues of strength and bravery (cf. Josh 1:7) in approaching the formidable being. In the LXX especially, Joshua’s question demonstrates the unity of Israel portrayed in the book, since the adversary is contrasted to those ‘of us’ (ημετερος) and hence no possibility of mutiny within the Israelite camp is anticipated by Joshua.
v. 14: The commander answers Joshua’s question in the MT with an enigmatic ‘no’, indicating he is outside of the categories used by Joshua. Despite the subsequent conquest narratives, the commander’s ‘no’ challenges ‘any attempt to tie the national aspirations too closely to YHWH’s purpose’. The function of this answer does not appear as a rebuke to Joshua because he failed to consider the role of the Lord (as Creach implies), but indicates the otherness of the being. A reader may naturally assume the ‘army of the Lord’ to be none other than the army of Israelites, however if this were the case then presumably the commander of the army would be Joshua himself. Once again, the divine realm resists close equivalence to the political nation of Israel. The reference to the צבא (army/host) of the Lord may allude to when ‘Deuteronomy 4:19 describes sun, moon and stars collectively as “all the hosts of heaven”’. Thus, the use of the term host may be foreshadowing the narrative of Joshua 10 where ‘Yahweh uses sun and moon to Israel’s benefit’. The Greek translation of chief-commander – αρχιστρατηγος - is explicitly applied to Michael in the Pseudepigraphical 2 Enoch 22:6 and so it is probably an angelic figure envisioned in this narrative.
When the phrase ‘now I have come’ is used in 2 Sam 14:15, it is followed by an explanation detailing the messenger’s coming. Its form here may have omitted the (originally given) reason for the commander’s visit. However, more probably this phrase is simply ‘intended as a fulfilment of Exod. 23:23’, continuing to build on the other allusions to the book of Exodus found in chapter 5 noted earlier.
Joshua’s response in the LXX removes the reference to worship (וישתחו) given in the Hebrew text; as this variation is not found in other manuscripts, it is likely this represents a choice of the translators. The original form, then, presents Joshua bowing down to a figure he calls ‘my Lord’ (אדני) but the LXX reflects a concern to avoid any notion of making the commander into a deity. Woudstra points out in a footnote that the commander is addressed as ‘adoni, not adonay; neither is the word “worship” by itself an indication of respect shown to a deity’. However, if this narrative continues in chapter 6, the close association between the commander and the Lord eases the transition for the Lord to begin speaking to Joshua in 6:2. That connection is hindered somewhat when the Septuagint is compelled to translate אדני as δεσποτα to avoid using a form of κυριος (which the LXX reserved for God when translating the sacred tetragrammaton (יהוה)).  The LXX form, then, fits more readily with the Masoretic division which separates this section from Josh 6:2 (contrary to Römer who suggests ‘Josh 6:2 and following as the continuation of Joshua’s encounter in 5:13-15’).
v. 15: The only command given to Joshua is to ‘loosen your sandal from upon your foot’. This adds to the sense that the passage has been cut short, and hence Römer’s suggestion that it is continued in chapter 6. Accepting the literal reading of the canonical text, the only practical purpose of the command seems to be an demonstration of obedience (which, it should be noted, is a theme of Joshua especially highlighted in 1:17, 22:2, and 24:4). The LXX, omitting the final words found in the MT ‘and Joshua did thus’, seems to reinforce the instinct to see this narrative being completed in the subsequent chapter or else to speculate that the original ending was removed. In response to this instinct, it is notable that the Exodus account does not add ‘and Moses did thus’ and so the LXX form reinforces the parallels to the Exodus passage through the removal of Joshua’s additional words. The command has obvious parallels to Exodus 3:5. The forms differ in that Joshua states the generic ‘it’, not the land, is holy; commentators have not explored this distinction in detail but it perhaps results from the visionary nature to imply that Jericho as an entity is now holy. This holiness of the land to be conquered may illuminate further discussion of the concept of חרם; in other books of the Hebrew Bible, especially priestly material, ‘that which is חרם is associated with that which is holy (קדש)’ so the attribution of holiness to Jericho here is notable. Tigchelaar’s insightful discussion on the reception of Ex 3:5 suggests that Joshua removing his sandals is the efficient cause and the temporal point at which the land henceforth becomes holy. He says that ‘it is striking that at the beginning of the book Joshua has been promised all the land which the sole of his feet treads upon [cf. Josh 1:3], and at the beginning of the conquest Joshua is told to take off his sandal’, and so this action is to be understood as a ritual work ratifying the handing over of the land to Joshua and the people of Israel.
Reflections on the Passage
In this scene, Joshua experiences a mysterious vision. A being appears as a human warrior, but divine characteristics surround him as he i) refuses to be categorized as either of or against Israel, ii) serves as chief-commander of the Lord’s army, and iii) receives Joshua’s obeisance. This close alignment to the divine might support the encounter continuing onwards from Josh 6:2, as Römer suggests. However, this reading is not necessary with the conclusion that the command to remove his sandals constitutes a ritual ratification causing the land to pass into the ownership of Israel (and thus be set apart as holy) because the narrative’s purpose is complete. The subsequent narrative is simply recording the physical taking of what has been already given by God through Joshua. Secondly, given this Moses-like encounter with a divine being (cf. Ex 3), and Joshua’s unique role in Israelite history, there is no need to provide a prophetic medium or angelic messenger for Joshua to receive instruction from the Lord.
To conclude, dramatic tensions with the rest of the book are created through this encounter. Firstly, the refusal of the chief-commander to state whose side he was fighting for is at odds with the rest of the book where the Lord is shown as the one fighting very clearly on behalf of Israel. Moreover, Joshua is silently and pre-emptively stripped of the title of ‘chief-commander of the army of the Lord’, a role he otherwise appears to fulfil as leader of the Israelite military. However, despite these tensions, the passage confirms the power of the Lord to enter and take possession of Jericho and that ‘the heavenly armies have been mobilized to fight’. The literary figure of Joshua is presented in this narrative in a manner that incorporates his key characteristics into a terse event. Closely linked to Moses’ commission, Joshua is shown to be courageous as he approaches the armed warrior, faithful as he falls prostrate, and obedient as he does what he is commanded. It is at this moment that the land is formally passed over to Israel; in Josh 1:2 it is still pledged to Israel as ‘the land I am about to give to them’ and now it has been given but is yet to be physically conquered.
Auld, A. Graeme. Joshua, Judges and Ruth. Edited by John C. L. Gibson. Edinburgh: St Andrew Press, 1984.
Azuelos, Yaacov. "The 'angel sent before the Lord' in Targum Joshua 5,14." Biblica 96 (2015): 161-178.
Bauer, Walter, William F. Arndt, and F. Wilbur Gingrich. A Greek English Lexicon of the New Testament and Other Early Christian Literature. Chicago: University of Chicago Press, 1957.
Brown, Francis, S. R. Driver, and Charles A. Briggs , The Brown-Driver-Briggs Hebrew and English Lexicon. Peabody, MA: Hendrickson, 2012 [reprint from Boston: Houghton, Mifflin and Company, 1906]
Coogan, Michael. “Joshua.” In The New Jerome Biblical Commentary, Student Edition, edited by Raymond E. Brown, Joseph A. Fitzmyer and Roland E. Murphy, 110-131. London: Geoffrey Chapman, 1993).
Creach, Jerome F. D. Joshua. Interpretation. Louisville, Kentucky: Westminster/John Knox Press, 2003.
Dickey, Eleanor. “Kyrie, Despota, Domine: Greek Politeness in the Roman Empire. (Critical Essay).” Journal of Hellenic Studies 121 (2001): 1-25.
Earl, Douglas Scotohu. “Reading Joshua as Christian Scripture.” PhD diss., University of Durham, 2008.
Hawk, L. D. Joshua. Collegeville, MN: Liturgical Press, 2000.
Marcus, David. “Alternate Chapter Divisions in the Pentateuch in the Light of the Masoretic Sections.” Hebrew Studies 44 (2003):119-128.
May, H. G. “Joshua.” In Peak’s Commentary on the Bible, edited by Matthew Black and H. H. Rowly, 289-303. London: Thomas Nelson and Sons, 1963.
Römer, Thomas. "Joshua's encounter with the commander of YHWH's army (Josh 5:13-15): Literary Construction or Reflection of a Royal Ritual?." In , edited by Brad E. Kelle, Frank Ritchel Ames and Jacob L. Wright, 49-63. Atlanta: Society of Biblical Literature, 2014.
Tigchelaar, Eibert, “Barefeet and Holy Ground: Excursive Remarks on Exodus 3:5 and its Reception.” In The Revelation of the Name YHWH to Moses: Perspectives from Judaism, the Pagan Graeco-Roman World, and Early Christianity, edited by George H. van Kotten. 17-36. Leiden: Brill, 2006.
 David Marcus, “Alternate Chapter Divisions in the Pentateuch in Light of the Masoretic Sections,” Hebrew Studies 44 (2003): 128.
 BDB 89a.
 Thomas Römer, "Joshua's Encounter with the Commander of YHWH's Army (Josh 5:13-15): Literary Construction or Reflection of a Royal Ritual?", in (Atlanta: Society of Biblical Literature, 2014), 53.
 Cf. Michael Coogan, "Joshua" in The New Jerome Biblical Commentary, Student Edition, ed. Raymond E. Brown et al. (London: Geoffrey Chapman, 1993), 116.
 E.g. BAG 744c notes ‘in Philo always of the angel’s flaming sword after Gen 3: 24)
 Cf. Römer, “Joshua’s Encounter,” 57-60.
 L. D. Hawk, Joshua (Collegeville, MN: Liturgical Press, 2000), 85.
 Cf. Jerome F.D. Creach, Joshua. Interpretation (Louisville, Kentucky: Westminster/John Knox Press, 2003), 60.
 A. Graeme Auld, Joshua, Judges and Ruth, ed. John C. L. Gibson (Edinburgh: St Andrew Press, 1984), 35.
 Auld, Joshua, 35.
 Cf. Yaacov Azuelos, "The Angel sent before the Lord' in Targum Joshua 5,14," Biblica 96 (2015): 171.
 Scripture reference from H. G. May, “Joshua” in Peake’s Commentary on the Bible, ed. Matthew Black and H. H. Rowly (London: Thomas Nelson and Sons, 1963), 293.
 Coogan, “Joshua,” 116.
 M.H. Woudstra, The Book of Joshua (Grand Rapids, MI: Eerdmans, 1981), 105.
 Cf. Eleanor Dickey, "Kyrie, Despota, Domine: Greek Politeness in the Roman Empire. (Critical Essay)" Journal of Hellenic Studies 121 (2001): 5.
 Römer, “Joshua’s Encounter,” 55.
 Douglas Scotohu Earl, “Reading Joshua as Christian Scripture” (PhD diss., University of Durham, 2008), 85.
 Eibert Tigchelaar, "Bare Feet and Holy Ground: Excursive Remarks on Exodus 3:5 and its Reception." In The Revelation of the Name YHWH to Moses: Perspectives from Judaism, the Pagan Graeco-Roman World, and Warly Christianity, (Leiden: Brill, 2006), 27.
 Hawk, Joshua, 83.