Social bonds, maintained by mutual investments of time and energy, have greatly influenced the evolution of social cognition and cooperation in many species [e.g., 1-8]. However, there are two pitfalls regarding "social bonds" as an explanation for social structure and cooperation [1, 9-11]. First, studies often incorrectly assume that frequent association implies partner fidelity based on mutual social preference, but even seemingly complex nonrandom interaction networks can emerge solely from habitat or spatial structure [12-16]. Second, the false appearance of partner fidelity can result from stable options in the "partner market" [1, 9-11, 17]. For instance, individuals might preferentially groom the same partner, even if the decision depends entirely on the immediate costs and benefits rather than relationship history. Given these issues, a key challenge has been testing the extent to which social structure is driven by the intrinsic relationship history versus the extrinsic physical and social environment. If stable bonds exist, they should persist even if the individuals are moved to a dramatically different physical and social environment. We tested this prediction by tracking social relationships among common vampire bats (Desmodus rotundus) moved from the lab to the wild. We show that allogrooming and food sharing among female vampire bats induced in captivity over 22months predicted their assortativity and association rates when we subsequently tracked them in the wild with custom-made high-resolution proximity sensors. The persistence of many relationships across different physical and social environments suggests that social structure is caused by both extrinsic constraints and intrinsic partner fidelity.