The lack of a supranational legal authority that can enforce private contracts across borders makes debt repayment in an international setting contingent on borrowers' willingness to pay rather than ability to pay. This market failure (i.e., inadequate enforcement) causes investment to fall short of its unconstrained level. This paper examines how foreign aid affects a country's willingness to honor private investment agreements. We consider two types of aid: technical assistance and loan subsidies. We show that when enforcement is inadequate, aid has the following effects: (i) it reduces default risk, promotes capital flows, and can, in principle, restore investment to its unconstrained level; (ii) when default risk is high, aid can increase the welfare of both the recipient and the donor country. Thus, foreign aid serves as an enforcement mechanism in an international setting. This provides a nonaltruistic rationale for foreign aid. Finally, we discuss the implications of providing bilateral versus multilateral aid (e.g., by individual countries versus multilateral organizations).