This paper examines the effect of trade integration and comparative advantage on one of a country's institutions, which in turn influences its economic efficiency. The environment we explore is one in which a country's lower classes may revolt and appropriate wealth owned by a ruling elite. The elite can avert revolution by incentivizing a potentially productive middle class to sink their human capital into a relatively unproductive bureaucracy. Thus the bureaucracy serves as an institution through which the elite can credibly commit to make transfers to the rest of society, but in the process this reduces economic efficiency. Trade integration alters the relative value of the elite's wealth. This alters the lower classes’ incentive to revolt on the one hand and the elite's incentive to subsidize participation in the inefficient bureaucracy on the other. Therefore, the interaction between a country's comparative advantage and an inefficient economic institution determines whether trade integration increases or reduces economic efficiency. The econometric findings support the model's main prediction.