Using new data on citations to university patents and scientific publications, we study how geography affects university knowledge spillovers. Citations to patents decline sharply with distance and are strongly constrained by state borders. The effect of distance on citations to scientific publications is less sharp, and the state border effect on publications is significant only for lower-quality public universities. We show that the state border effect is heterogeneous and strongly influenced by university and state characteristics and policies. It is larger for universities that are public and that have strong local development policies, and in states with strong noncompete labor laws, greater reliance on in-state educated scientists, and lower rates of interstate scientific labor mobility. We confirm the impact of noncompete statutes by studying a policy reform in Michigan.