Qarghuyah or Qarquya was an important Arab administrator in the Hamdanid Dynasty under Sayf al-Dawla, who would go on to control Aleppo himself and even sign the Treaty of Safar with the Byzantine Empire as the ruling emir of Aleppo. On January 7, 965, Qarghuyah was appointed governor of Aleppo by Sayf al-Dawla, who had by that point retreated to Martyropolis, moving against an advancing Byzantine army lead by Nikephoros II Phokas. On October 29, 965, a rebel force led by the former secretary of Tarsus, Rashiq al-Nasimi, approached Aleppo while Sayf al-dawla was away from the city. After three months, he managed to capture a lower part of the town, but was killed in an attack on the citadel on January 8, 966. Sayf al-Dawla died on 8 February of 967 in Aleppo. He was succeeded by his son, Sa'd al-Dawla, who reached Aleppo on June/July 967. Around April 968, the same month the rebellion of Abu Firas failed, Qarghuyah convinced Sa'd al-Dawla to leave Aleppo. Following this, Qarghuyah seized power for himself but was immediately besieged by an unknown rival. Qarghuyah appealed to the nearby Byzantine general, Petros, for aid, who was then besiegingAntioch with Michael Bourtzes. Following the capture Antioch, Petros and Bourtzes made their way to Aleppo, defeating Qarghuyah's rival quickly. They then in turn besieged Aleppo from 14 December to 11 January, successfully defeating Qarghuyah and his defenders. Following the siege, Petros and Bourtzes forced Qarghuyah and his deputy, Bakjur, to sign the Treaty of Safar, which stipulated that Aleppo, Homs, and the whole "province" would pay tribute to Byzantium, while Qarghuyah would be guaranteed rule over Aleppo, and Bakjur would be designated as his successor. In 975, Bakjur deposed and imprisoned Qarghuyah and seized control of the Emirate for himself. Two years later, Sa'd al-Dawla returned to Aleppo after defeating Bakjur, who he exiled to Homs, and elevated Qarghuyah to his previous post as deputy. He died around April in 990 in Aleppo.