[citation needed] After Vicko Bujović was killed, Matija left Perast as he was accused of being involved in his death.
[7] Impressed with Zmajević's education and maritime skills, the tsar accepted him into military service and sent him to Saint Petersburg, where he became commodore captain and further rose in rank.
[9] In 1719, he was promoted to rear admiral and his fleet won the last naval battle of the Great Northern War, forcing the Swedes to sign the Treaty of Nystad.
[10] He was reprieved at the last minute and relegated to the post of governor of the Astrakhan area with the rank of vice-admiral, where he spent last years of his life.
[8] He worked on establishment of the Black Sea Fleet,[6] which would play a significant role in Russian expansion to the south after his death.