We interpret historical evidence in light of a repeated-game model to
conclude that merchant guilds emerged during the late medieval period
to allow rulers of trade centers to commit to the security of alien me
rchants. The merchant guild developed the theoretically required attri
butes, secured merchants' property rights, and evolved in response to
crises to extend the range of its effectiveness, contributing to the e
xpansion of trade during the late medieval period. We elaborate on the
relations between our theory and the monopoly theory of merchant guil
ds and contrast it with repeated-game theories that provide no role fo
r formal organization.