Ghazni is a city in southeastern Afghanistan, which served as the capital of the Ghaznavid Empire from 977 to 1163.