Armenians in the territory of the Khanate lived under the immediate jurisdiction of the "melik" of Erivan, from the House of the Melik-Aghamalyan family, who had the sole right to govern them with the authorization of the shah. The inception of the melikdom of Erivan appears only after the end of the last Ottoman-Safavid war in 1639 and seems to have been a part of an overall administrative reorganization in Iranian Armenia after a long period of wars and invasions. The first known member of the family is a certain Melik Gilan but the first certain holder of the title of "melik of Erivan" was Melik Aghamal and it may be from him that the house had taken its surname. One of his successors, Melik-Hakob-Jan, attended the coronation of Nader Shah in the Mugan plain in 1736.