[1] Educated in the major cultural center of Nishapur, and employed at the court of the famous Ghaznavid Sultan Mahmud, Bayhaqi was a highly cultured man, whose magnum opus—the Tarikh-i Bayhaqi, is seen as the most reliable source of valid information about the Ghaznavid era, which was written in an exquisite and vivid Persian prose that would become an ideal model for several eras.
[1] In his youth Bayhaqi studied in the major cultural center of Nishapur, and later in 1020/1 joined the secretariat (dīvān-e resālat) of Mahmud, where he worked as an assistant and pupil under the chief secretary Abu Nasr Mushkan for 19 years.
[4] After Mushkan's death in 1039/40, Mas'ud I (r. 1030–1040) appointed Bayhaqi as minister to Abu Sahl Zawzani, who had succeeded Muskhan as the chief secretary of the empire.
According to Ibn Funduq, he was jailed by the judge (qāżī) of Ghazni on the complaint of having failed to meet the unpaid obligatory fee to a wife, but according to Aufi, the reason behind his imprisonment was due to the ploys of his enemies.
[4] In 1052, the rebellious slave-soldier (ghulam) Toghrul seized Ghazni, had Abd al-Rashid killed, and had the sultan's men jailed in a stronghold, where Bayhaqi was also moved.