And he showed me Joshua the high priest standing before the angel of the Lord. And Satan was standing at his right hand, to oppose him. And the Lord said to Satan: The Lord rebuke you, Satan, and the Lord rebuke you, he who has chosen Jerusalem. Is not this a brand plucked out of the fire? And Joshua was clothed in filthy garments, and was standing before the face of the angel, who answered and said to those who were standing before him, saying: Take away the filthy garments from him. And he said to him: Behold, I have taken away your iniquity from you, and I have clothed you with changes of r...aiment. And he said: Put a clean tiara upon his head; and they put a clean tiara upon his head, and they clothed him with garments. LXX: And the Lord showed me Joshua the high priest, standing before the face of the angel of the Lord, and the devil was standing at his right hand, to oppose him. And the Lord said to the devil: The Lord rebuke you, devil, and the Lord who has chosen Jerusalem rebuke you. Is not this like a brand plucked out of the fire? And Joshua was clothed in filthy garments, and was standing before the face of the angel, and he answered and said to those standing before his face, saying: Take away the filthy garments from him. And he said to him: Behold, I have taken away your iniquities from you; and clothe him with a robe reaching to the feet, and set a clean tiara upon his head; and they set a clean tiara upon his head, and they put garments about him. Before we come to the spiritual understanding, we must say succinctly and briefly how the Hebrews explain this passage. Joshua (Iesus, the same name as Jesus) the high priest, whom the Greeks call ἀρχιερέα, the Latins pontiff, they take to be the son of Jehozadak, who presided over the people together with Zerubbabel. At his right hand the adversary was standing (for this is what satan means), to oppose him. And rightly was he standing at his right hand, not at his left, because the accusation was true, since he too, along with the rest, had taken a foreign wife, as is written most fully in Ezra and in Malachi, who follows this prophet.
Source: Commentary on Zechariah