Life. In his youth Bayhaqī studied in Nīšāpūr, at that time an important cultural center; he later joined the secretariat (dīvān-e resālat) of Maḥmūd of Ḡazna (Roknī; Nāzim, pp. 142-44; Bosworth, 1963, p. 91), where for nineteen years he worked under Abū Naṣr Moškān (q.v.), becoming his assistant and protégé (Bayhaqī, p. 795). He was given the task of composing or preparing fair copies of important letters at court (ibid., pp. 845-52). He thus observed at close quarters the reigns of Maḥmūd (in part), Amīr Moḥammad, Masʿūd I b. Maḥmūd, Mawdūd, Masʿūd II, Bahāʾ-al-Dawla ʿAlī b. Masʿūd, ʿEzz-al-Dawla ʿAbd-al-Rašīd, the usurper Ṭoḡrel, Amīr Farroḵzād b. Masʿūd (see below), and Ẓahīr-al-Dawla Ebrāhīm, a period extending from 412/1021-22 to 470/1077. Owing to his vantage point near the center of power, he was very well informed about current events. After the death of Abū Naṣr Moškān in 431/1039, Masʿūd appointed Bayhaqī as deputy to Abū Sahl Zūzanī (or Zawzanī; q.v.), the new head of the secretariat. Abū Naṣr had in fact recommended to the sultan that Bayhaqī be chosen as his successor, and the vizier Aḥmad b. ʿAbd-al-Ṣamad had also praised Bayhaqī in the sultan’s presence. Masʿūd is reported to have said in private that, but for his youth, Bayhaqī, who was at that time forty-six years old, would have been named head of the secretariat.
Abū Sahl was not as adept in the affairs of the secretariat as his predecessor had been, and his ways were entirely different; nor was his deputy immune to his bad temper. Bayhaqī therefore wrote a confidential letter of resignation to the sultan, asking for another assignment. Masʿūd, however, encouraged Bayhaqī to carry on and ordered his vizier to instruct Abū Sahl that Bayhaqī should receive proper treatment at the secretariat. Abū Sahl thus treated Bayhaqī with respect as long as Masʿūd lived; later, however, his conduct changed again. Bayhaqī did encounter difficulties after Masʿūd’s death in 432/1041 (ibid., pp. 800-01), perhaps partly because of shortcomings of his own, which he himself occasionally acknowledges.
During the reign of ʿAbd-al-Rašīd (441-44/1049-52) Bayhaqī was appointed head of the secretariat, only to be removed shortly afterward. According to Ebn Fondoq (p. 177), he was imprisoned by the judge (qāżī) of Ḡazna on the charge of having failed to pay the marriage portion (mahr) due to a wife, but ʿAwfī claims in his Jawāmeʿ al-ḥekāyāt (pt. 3, chap. 18) that the cause of his imprisonment was the machinations of his enemies. On the sultan’s orders a slave by the name of Tūmān (or Nūyān, or Yūnān?) plundered Bayhaqī’s property. When Ṭoḡrel—a runaway slave of the house of Maḥmūd—came to power and put ʿAbd-al-Rašīd to death (444/1052), he imprisoned the sultan’s servants in a fortress, to which Bayhaqī was also transferred from the magistrate’s jail. Ṭoḡrel’s rule lasted only fifty days, however; he was then killed, and the Ghaznavids returned to power. Bayhaqī was released.
According to Ebn Fondoq (p. 175), he served as secretary under Sultan Farroḵzād (444-51/1052-59) and at the end of the latter’s reign retired from court service and settled down in Ḡazna to write his history. From Bayhaqī’s own occasional comments on Farroḵzād’s rule in the extant part of his book (pp. 116, 132, 137, 163, 175, 221, 253, 314, 318, 332, 358, 377, 480, 483), however, it does not seem that he worked at Farroḵzād’s court. In fact, he clearly states that during those years he was working on his history. According to Ṣadr-al-Dīn Ḥosaynī in Aḵbār al-dawla al-saljūqīya (Chronicles of the Saljuq state; p. 29), Bayhaqī drafted the peace treaty (ketāb al-ṣolḥ) between the Saljuq Čaḡrī Beg and the Ghaznavids toward the end of Farroḵzād’s reign; he may thus have been invited back to work after his disgrace and incarceration during the reign of ʿAbd-al-Rašīd (see Bosworth, 1977, pp. 48, 52). In any event the contents of Tārīḵ-eBayhaqī clearly show that in his old age, until his death in 470/1077, the author devoted himself entirely to writing.