Zmajević was born in Perast, in the Bay of Kotor, at the time part of the Republic of Venice (now Montenegro) on 3 May 1640.
The Zmajević family hailed from Njeguši; when the last members of the Crnojević family left Principality of Zeta, Nikola Zmajević and his cousins Ivaniš and Vučeta moved to Kotor.
Becoming appealed and somewhat wealthy, the family quickly converted from Orthodoxy in favour of Roman Catholicism,[1] with the three marrying Catholic girls and having their children baptized in the Latin Rite.
[citation needed] In 1675, he was sent to expel the pirates in Ulcinj who had sacked throughout the Adriatic Sea, for which he was awarded a golden necklace by the Senate.
[citation needed] In 1679 he was elected town captain for the second time, in a period when Perast saw an expansion in defence against the Ottomans and pirates.