Two types of theories of the firm have emerged in scholarship. Economic theories concern the allocation of control rights and residual claims: under an economic theory, a firm is a group of assets under common ownership. Legal theories focus on the legal significance of firm boundaries: under a legal theory, each firm is a legal person. Thus, assets may be economically integrated under common control and yet be partitioned between distinct legal entities. This paper presents a theory of legal boundaries that focuses on the choice of capital structure and traces the interplay between economic integration and legal partitioning. The law treats many capital-structure decisions, including both financial and governance choices, as in personam rather than in rem. Thus, these decisions must be made firm wide; they include the issuance of debt or equity, the adoption of takeover defenses, and the composition of the board of directors. Yet the determinants of optimal capital structure are often asset contingent. For example, the amount of leverage, the desirability of takeover defenses, and the number of independent directors may vary with the industry. The resulting tension is significant in the choice of firm boundaries. If two groups of assets have divergent capital-structure demands–in that the optimal design of financial and governance rights related to each group is different–then either the assets are put in separate firms that tailor capital structure to their respective asset groups or they are combined in a single firm with a blended capital structure. We suggest that legal integration into a single firm sacrifices efficiency in some cases but not in others. Where the efficiency losses are large enough to offset countervailing advantages from legal integration, legal partitioning might occur. We also demonstrate, however, that legal partitioning may undermine the benefits from economic integration, even if the discrete firms are kept under common control, as that concept is defined in law. Our theory thus suggests additional factors to be considered in explaining the structure of combinations (such as mergers or acquisitions) and divestitures (such as spin-offs, carve-outs, or securitizations).