This paper develops a theoretical framework to study the interaction between globalization and political structure. We show that political structure adapts in a non- monotonic way to declining transport costs. Borders hamper trade. At an earlier stage, the political response to expanding trade opportunities consists of removing borders by increasing country size. At a later stage, instead, it consists of removing the cost of borders by creating international unions. This leads to a reduction in country size. Moreover, diplomacy replaces conquest as a tool to ensure market access. These predictions are consistent with historical evidence on trade, territorial changes and membership of international unions.