A fast on the month of Tishrei other than Yom Kippur was first mentioned in the Book of Zechariah (8:19), the second to last book of prophecies in the Hebrew Bible:
Thus said the Lord of Hosts: the fast of the fourth month, the fast of the fifth month, the fast of the seventh month, and the fast of the tenth month shall become occasions for joy and gladness, happy festivals for the House of Judah; but you must love honesty and integrity.
The fast of the seventh is a reference to a fast on the month of Tishrei, and from the fact that it is listed alongside the 17th of Tamuz (the fourth month), 9th of Av (fifth), and the 10th of Tevet (tenth) suggests that it does not mean the really big fast of Tishrei, Yom Kippur, but a minor fast, one of the four of which the prophet Zechariah was aware (the fast of Esther was added later).
However, Zechariah’s fast of the seventh month does not refer to the 3rd of Tishrei but rather to the 24th, when, according to the book of Nehemiah, the returners to Zion atoned for marrying non-Jewish wives.
Our source for the Fast of Gedaliah is the Gemara in tractate Rosh Hashanah: “The fast of the seventh,” this is the third of Tishrei, on which Gedaliah, son of Ahikam, was killed. And who killed him? Ishmael, son of Nethaniah, killed him (see II Kings 25:25; Jeremiah, chapter 41). The Sages established a fast to commemorate Gedaliah’s death to teach you that the death of the righteous is equivalent to the burning of the Temple of our Lord. And why did the prophet call it the fast of the seventh? Because Tishrei is the seventh month of the year.
As described in the book of Jeremiah (41:1-9), Gedaliah, the governor of Judea appointed by the Babylonians after the destruction of the First Temple, was murdered by a group of Jews led by Ishmael ben Netanya, who was a scion of the royal dynasty. He was warned about the assassination plot by his loyalists––the army commander Yohanan ben Korah and his men. Yohanan even requested that Gedaliah take preemptive action, but Gedaliah did not believe him and refused his suggestion.
Gedaliah was murdered while sitting in the watchtower, (believed to be today’s Nabi Samuel), and his supporters and even the Babylonian soldiers who were stationed there were slaughtered with him. The murder was carried out under the direction of Belis, the king of Ammon.
Gedaliah’s murder ended the existence of any Jewish autonomy in the Land of Israel after the destruction of the First Temple. As a result, most of the Jews fled the country to Egypt, fearing the wrath of the Babylonians. The destruction of Jewish sovereignty was thus complete and remained so until the return to Zion under the Persian King Cyrus.
The text in Jeremiah is haunting:
In the seventh month, Ishmael son of Nethaniah son of Elishama, who was of royal descent and one of the king’s commanders, came with ten men to Gedaliah son of Ahikam at Mizpah; and they ate together there at Mizpah. Then Ishmael son of Nethaniah and the ten men who were with him arose and struck down Gedaliah son of Ahikam son of Shaphan by the sword and killed him because the king of Babylon had put him in charge of the land. Ishmael also killed all the Judeans who were with him—with Gedaliah in Mizpah—and the Chaldean soldiers who were stationed there.
The second day after Gedaliah was killed, when no one yet knew about it, eighty men came from Shechem, Shiloh, and Samaria, their beards shaven, their garments torn, and their bodies gashed, carrying meal offerings and frankincense to present at the House of God. Ishmael son of Nethaniah went out from Mizpah to meet them, weeping as he walked. Upon meeting them, he said, “Come to Gedaliah son of Ahikam.” When they came inside the town, Ishmael son of Nethaniah and the men who were with him slaughtered them [and threw their bodies] into a cistern.
But ten men among them said to Ishmael, “Don’t kill us! We have stores hidden in a field—wheat, barley, oil, and honey.” So he stopped and did not kill them along with their fellows.
The cistern into which Ishmael threw all the corpses of the men he had killed in the affair of Gedaliah was the one that King Asa had constructed against King Baasha of Israel. That was the one which Ishmael son of Nethaniah filled with corpses.
This political murder is considered a catastrophe of historical proportions, hence the fast on the 3rd of Tishrei – although according to tradition––cited by the author of the Shulchan Aruch, Rabbi Yosef Karo––the assassination took place on the first of Tishrei, but we don’t fast on Torah-prescribed holidays.
Some traditions compare the fast of Gedaliah to Tisha B’Av because Gedaliah was the last acceptable leader of the people in the Land of Israel, and after his murder, the people were completely disintegrated.