Depending on their historical context they filled functions relating to defense, security, health, trade, taxation, and representation, and were correspondingly staffed by military or municipal authorities.
The city gate was also commonly used to display diverse kinds of public information such as announcements, tax and toll schedules, standards of local measures, and legal texts.
It could be heavily fortified, ornamented with heraldic shields, sculpture or inscriptions, or used as a location for warning or intimidation, for example by displaying the heads of beheaded criminals or public enemies.
Many cities would close their gates after a certain curfew each night, for example, a bigger one like Prague or a smaller one like the one in Flensburg, in the north of Germany.
Many surviving gates have been heavily restored, rebuilt or new ones created to add to the appearance of a city, such as Bab Bou Jalous in Fes.