Dmitriy Yurievich Shemyaka (Дмитрий Юрьевич Шемяка in Russian) (died 1453) was the second son of Yury of Zvenigorod by Anastasia of Smolensk and grandson of Dmitri Donskoi. His hereditary patrimony was the rich Northern town Galich-Mersky. Shemyaka (1445, 1446–1447) was twice Grand Prince of Moscow. The causes of the Muscovite Civil War waged in the second quarter of the 15th century are still disputed. No small part, however, was played by Dmitri Donskoi's will, which ran contrary to Rurikid dynastic custom whereby the throne would pass from an elder brother to a younger one (agnatic seniority), rather than from father to son (primogeniture). The testament provided for the accession of his son, Vasily I, which was still in keeping with the tradition of lateral succession since Vasily was the eldest of his generation. In the event of Vasily having no surviving son at his death, his brother, Dmitry's second son, Yury of Zvenigorod, was to succeed as grand prince in Moscow. Upon Vasily I's death, however, Yury refused to come to Moscow and swear allegiance to his nephew, Vasily II, and claimed the throne himself in accordance with his right under the long-held custom of lateral inheritance. (He further claimed it was provided for in Dmitry's testament – but this ignored the provision that voided Yury's succession in the event of Vasily I producing a son). Yury's son, Dmitry Shemyaka, actively participated in all of his father's incursions against Moscow, culminating in Yury's capture of Moscow and accession as grand prince in 1433. Yury of Zvenigorod died in Moscow in 1434. After Yury's death, Shemyaka continued to press his branch's claim to the grand princely throne, and was seldom at peace with Vasily II. Initially, Dmitry and his younger brother Dmitry Krasnyi concluded an alliance with Vasily against their elder brother Vasily Kosoy, who had proclaimed himself grand prince. They succeeded in driving Kosoy from Moscow and were rewarded with the towns of Uglich and Rzhev. The following year Shemyaka came to Moscow in order to invite Vasily II to his impending wedding with a princess of Yaroslavl, but was accused of siding with Kosoy and taken prisoner. He was released on the eve of a decisive clash between Vasily II and Vasily Kosoy. This action of Vasily II was successful - Shemyaka and his people did not help Vasily Kosoy and so he was completely defeated in the battle