The fall of the Ak Koyunlu brought the city immediately into the sphere of the newly formed Iranian Safavid dynasty, led by king (shah) Ismail I (r. Ismail I laid siege to Baku in 1501 and captured it; he allowed the Shirvanshahs to remain in power, under Safavid suzerainty. 1524–1576), completely removed the Shirvanshahs from power, and made Baku a part of the Shirvan province.
Baku remained as an integral part of his empire and the successive Iranian dynasties to come for the next centuries, until the irrevocable cession in the first half of the 19th century.
Between the 12th and 14th centuries, massive fortifications were undertaken in Baku and the surrounding towns.
The Maiden Tower, the Ramana Tower, the Nardaran Fortress, the Shagan Castle, the Mardakan Castle, the Round Castle and also the famous Sabayil Castle on the island of the Bay of Baku was built during this period.
Further archeological excavations revealed various prehistoric settlements, native temples, statues and other artifacts within the territory of the modern city and around it.This is one of the earliest written evidences for Baku.Baku was the realm of the Shirvanshahs during the 8th century CE.The city frequently came under assault of the Khazars and (starting from the 10th century) the Rus.Shirvanshah Akhsitan I built a navy in Baku and successfully repelled another Rus assault in 1170.Many sizeable Azerbaijani institutions have their headquarters there.The Baku International Sea Trade Port is capable of handling two million tons of general and dry bulk cargoes per year.According to the Lonely Planet's ranking, Baku is also among the world's top ten destinations for urban nightlife.The city is the scientific, cultural and industrial center of Azerbaijan.In recent years, Baku has become an important venue for international events.It hosted the 57th Eurovision Song Contest in 2012, the 2015 European Games, the 2016 European Grand Prix, 4th Islamic Solidarity Games and Azerbaijan Grand Prix in 2017, and will host UEFA Euro 2020.