Four years later, when Dmitry had turned 18, he was welcomed back to Novgorod and — together with his future son-in-law, Daumantas of Pskov — led a local militia against Livonian Knights in the Battle of Rakvere. During the following decade, he struggled for control of Novgorod against his uncles, Yaroslav III and Vasily of Kostroma. In 1276, when his elders died, he finally ascended the coveted thrones of Vladimir and Novgorod. Two years later, he founded a great fortress of Koporye, which he intended to rule himself. The Novgorodians revolted, forcing Dmitry to leave Koporye and Novgorod altogether.