Abstract. I provide novel empirical evidence grounded in an original theoretical framework to explain why colocation matters for the rate, direction, and quality of scientific collaboration. To address endogeneity concerns due to selection into colocation and matching, I exploit the constraints imposed on the spatial allocation of labs on the Jussieu campus of Paris by the removal of asbestos from its buildings. Consistent with search costs constituting a major friction to collaboration, colocation increases the likelihood of joint research by 3.5 times, an effect that is mostly driven by lab pairs that face higher search costs ex ante. Furthermore, separation does not negatively affect collaboration between previously colocated labs. However, while colocated labs grow increasingly similar in topics and literature cited, separated ones embark on less correlated research trajectories. Research outcomes, instead, seem to be mostly influenced by how distance affects execution costs: after colocation, labs are more likely to pursue both lower-quality projects (a selection effect) and high-quality projects (an effort effect). Opposite effects on quality are observed after separation. Whereas search costs affect which scientists are likely to collaborate together, execution costs shape the quality of their output.