The Shulchan Aruch · Orach Chayim
אורח חיים תקנ״זOrach Chayim 557
Siman 557 of 697 in Orach Chayim — 1 se'if
הלכות תשעה באבLaws of the Ninth of Av· siman 557
Se’if 1א׳
בְּתִשְׁעָה בְּאָב אוֹמֵר בְּבוֹנֵה יְרוּשָׁלַיִם: נַחֵם ה' אֱלֹהֵינוּ אֶת אֲבֵלֵי צִיּוֹן וְכו', וַעֲנֵנוּ בְּשׁוֹמֵעַ תְּפִלָּה; וְאִם לֹא אָמַר לֹא זֶה וְלֹא זֶה, אֵין מַחֲזִירִין אוֹתוֹ. הַגָּה: וְהַמִּנְהָג פָּשׁוּט שֶׁאֵין אוֹמְרִים נַחֵם רַק בִּתְפִלַּת מִנְחָה שֶׁל תִּשְׁעָה בְּאָב, לְפִי שֶׁאָז הִצִּיתוּ בַּמִּקְדָּשׁ אֵשׁ וְלָכֵן מִתְפַּלְּלִים אָז עַל הַנֶּחָמָה (רוֹקֵחַ וְאַבּוּדַרְהַם). מִי שֶׁאָכַל בְּתִשְׁעָה בְּאָב, יֹאמַר נַחֵם בְּבִרְכַּת הַמָּזוֹן (מַהֲרִי"ל).
On Tisha Be-Av we say [during] the blessing of "Bo-neh Yerushalayim" {in the Amidah}: {Nachem} "Console My L-rd my G-d the mourners of Zion etc ..", and "Aneinu" during "Shomeya Tefilah", but if one did not say one nor the other, we do not make them go back. Rema Note: The simple custom is not to say Nachem except during the Minchah prayer on Tisha be-Av, for it was then {in the afternoon} that the fire took hold in the Mikdash, and therefore we pray at this time about the consolation (Rohach, Avudrahum). One who ate on Tisha be-Av, would say "Nachem" {instead of "Rachem"} in Grace after meals (Maharil).
Shulchan Aruch, Orach Chayim — Torat Emet 363 edition, via Sefaria — public domain
English: Shulchan Aruch, Wikisource, via Sefaria — CC BY-SA