 Complete the following phrase:  When the Shirvanshah Shah dynasty was ended by the Safavid Shah Tahmasp I, Shirwan formed a province of the Safavids and was usually governed by a Khan, who is often called Beylerbey. Shirvan was taken by the Ottomans in 1578; however, Safavid rule was restored by 1607. In 1722, during the 