Dymitr of Goraj (Polish: Dymitr z Goraja) (ca.1340–1400) of Clan Korczak was a Grand Crown Marshal from 1390 and Court Treasurer in the years 1364–1370 and 1377–1391. He was one of the wealthiest magnates of his era, and a mentor and adviser to Queen Jadwiga of Poland. Dymitr was born around 1340 as the son of Piotr of Klecia (Piotr z Klecia), starost of Zhydachiv, member of the Korczak family (using the Korczak coat of arms) and owner of the village of Klecie. Piotr became a member of the royal court of Poland, and Dymitr quickly joined him there. Around that time Dymitr converted from Orthodox to Catholic faith. In 1364, at the court of Casimir III the Great (last king of the Piast dynasty) he became the Court Treasurer, a title he would held in the years 1364–1370 (the year of Casimir's death) and again in the years of 1377–1391. Dymitr was member of the royal council, adviser to the king, and a witness of his death. As a trusted advisor to the King he was a signatory to the Act of Union of Horodlo of 1413 and he signed peace in Brest Kujawski, on December 31, 1435. In 1377, Dymitr and his brother Iwan received lands (including Goraj) from Louis I of Hungary (Louis was for a period a king of Poland). Dymitr would be one of the most notable supporters of Louis in Poland, possibly even his friend, and took part in important diplomatic missions on behalf of Louis. Dymitr became a mentor and adviser of the Louis daughter and Polish queen Jadwiga of Poland. He (successfully) opposed her marriage to William, Duke of Austria, an event which Jan Długosz described in his chronicles, and Jan Matejko and Wojciech Gerson reflected in their paintings. Both depict Jadwiga with an ax, supposedly taken for hacking gates, locked to prevent her running away with William, and Dymitr stopping her. He was involved in her marriage with Władysław Jagiełło (Jogaila), and received significant lands from him as well, particularly when Ruthenian territories were passed from the Grand Duchy of Lithuania to the Kingdom of Poland. Dymitr would become a strong supporter of Jagiełło, his trusted envoy in diplomatic missions, and would take part on his side during the Polish–Teutonic Wars. In 1390 he married Beata, daughter of Mścigniew Awdaniec, voivode of Kraków; they would have three daughters, Anna, Elizabeth and Catherine who in 1413 married Dobiesława of Oleśnica of the Dębno noble family. Through this marriage he became the Lord of Rymanowa, a town in Krosno County, Subcarpathian Voivodeship. He begaun construction of a Castle here and in 1409 hosted King Władysław Jagiełło here. That year he also became the Grand Crown Marshal. Having received significant lands due to his marriage, as well as from the three kings of Poland he has served, Dymitr became one of the wealthiest magnates of his era. He is known to have supported the economic development of the territories he governed. He died on February 20, 1400 and was buried in the church in Zawichost.