6וְהֵיאַךְ דִּין עִיר הַנִּדַּחַת. בִּזְמַן שֶׁתִּהְיֶה רְאוּיָה לְהֵעָשׂוֹת עִיר הַנִּדַּחַת. בֵּית דִּין הַגָּדוֹל שׁוֹלְחִין וְדוֹרְשִׁין וְחוֹקְרִין עַד שֶׁיֵּדְעוּ בִּרְאָיָה בְּרוּרָה שֶׁהֻדְּחָה כָּל הָעִיר אוֹ רֻבָּהּ וְחָזְרוּ לַעֲבוֹדַת כּוֹכָבִים. אַחַר כָּךְ שׁוֹלְחִים לָהֶם שְׁנֵי תַּלְמִידֵי חֲכָמִים לְהַזְהִירָם וּלְהַחֲזִירָם. אִם חָזְרוּ וְעָשׂוּ תְּשׁוּבָה מוּטָב וְאִם יַעַמְדוּ בְּאִוַּלְתָּן בֵּית דִּין מְצַוִּין לְכָל יִשְׂרָאֵל לַעֲלוֹת עֲלֵיהֶן לַצָּבָא וְהֵן צָרִין עֲלֵיהֶם וְעוֹרְכִין עִמָּהֶן מִלְחָמָה עַד שֶׁתִּבָּקַע הָעִיר. כְּשֶׁתִּבָּקַע מִיָּד מַרְבִּין לָהֶם בָּתֵּי דִּינִין וְדָנִים אוֹתָם. כָּל מִי שֶׁבָּאוּ עָלָיו שְׁנֵי עֵדִים שֶׁעָבַד כּוֹכָבִים אַחַר שֶׁהִתְרוּ אוֹתוֹ מַפְרִישִׁין אוֹתוֹ. נִמְצְאוּ כָּל הָעוֹבְדִים מִעוּטָהּ סוֹקְלִין אוֹתָן וּשְׁאָר הָעִיר נִצּוֹל. נִמְצְאוּ רֻבָּהּ מַעֲלִין אוֹתָן לְבֵית דִּין הַגָּדוֹל וְגוֹמְרִין שָׁם דִּינָם וְהוֹרְגִין כָּל אֵלּוּ שֶׁעָבְדוּ בְּסַיִף. וּמַכִּין אֶת כָּל נֶפֶשׁ אָדָם אֲשֶׁר בָּהּ לְפִי חָרֶב טַף וְנָשִׁים אִם הֻדְּחָה כֻּלָּהּ. וְאִם נִמְצְאוּ הָעוֹבְדִים רֻבָּהּ מַכִּים אֶת כָּל הַטַּף וְנָשִׁים שֶׁל עוֹבְדִים לְפִי חָרֶב. וּבֵין שֶׁהֻדְּחָה כֻּלָּהּ בֵּין שֶׁהֻדְּחָה רֻבָּהּ סוֹקְלִין אֶת מַדִּיחֶיהָ וּמְקַבְּצִין כָּל שְׁלָלָהּ אֶל תּוֹךְ רְחוֹבָהּ. אֵין לָהּ רְחוֹב עוֹשִׂין לָהּ רְחוֹב. הָיָה רְחוֹבָהּ חוּצָה לָהּ בּוֹנִין חוֹמָה חוּץ מִמֶּנּוּ עַד שֶׁיִּכָּנֵס לְתוֹכָהּ שֶׁנֶּאֱמַר אֶל תּוֹךְ רְחֹבָהּ. וְהוֹרְגִין כָּל נֶפֶשׁ חַיָּה אֲשֶׁר בָּהּ וְשׂוֹרְפִין אֶת כָּל שְׁלָלָהּ עִם הַמְּדִינָה בָּאֵשׁ. וּשְׂרֵפָתָהּ מִצְוַת עֲשֵׂה שֶׁנֶּאֱמַר (דברים יג יז) "וְשָׂרַפְתָּ בָאֵשׁ אֶת הָעִיר וְאֶת כָּל שְׁלָלָהּ":
What is the judgment rendered against an עיר הנדחת when all the criteria for that judgment have been met? The supreme Sanhedrin sends [emissaries] who investigate and probe until they have established clear proof that the entire city - or the majority of its inhabitants - have turned to the worship of false gods. Afterwards, they send two Torah sages to warn them and to motivate them to repentance. If they repent, it is good. If they continue their wicked ways, the court commands the entire Jewish people to take up arms against them. They lay siege to the city and wage war against it until the city falls. When the city falls, very many courts are set up, and [the inhabitants] are judged. All those people against whom two witnesses testify that they worshiped a false deity after receiving a warning are separated. If those who worshiped [the false deity] constitute only a minority [of the city's inhabitants], they are stoned to death, but the rest of the city is saved. If they constitute a majority, they are brought to the supreme Sanhedrin and their judgment is concluded there. All those who worshiped [the false deity] are executed by decapitation. If the entire city was led astray, all of the inhabitants including the women and the children are slain by the sword. If a majority of the inhabitants were led astray, the transgressors' wives and children are slain by the sword. Whether the entire city or only a majority of its inhabitants were led astray, those who proselytized [on behalf of the false deity] are stoned to death. All the property within it is collected within its main street. If it does not have a main street, a main street is made for it. If its main street is located outside its confines, its wall is extended until its [main street] is included within its confines, as [implied by Deuteronomy 13:17]: "[Gather all its goods] in the midst of its main street." All live animals that are contained within are slain. All its property and the city [as a whole] are burned with fire. Burning them fulfills a positive commandment, as [the verse continues]: "Burn the city and all its goods entirely."