There was an underground passage from here under the minaret which you see outside.
Photo essay: The ongoing formation of the Republic of Azerbaijan