https://www.btstories.com/jericho/
While the people were still at Gilgal, Joshua looked toward Jericho and saw a man standing nearby with a sword in his hand. Joshua walked toward him and asked, “Are you for us, or for our enemies?”
The man said, “I am captain of the Lord’s army. I’ve just arrived.”