Farming was first introduced to Europe in the mid-seventh millennium bc, and was associated with migrants from Anatolia who settled in the southeast before spreading throughout Europe. Here, to understand the dynamics of this process, we analysed genome-wide ancient DNA data from 225 individuals who lived in southeastern Europe and surrounding regions between 12000 and 500 bc. We document a west-east cline of ancestry in indigenous hunter-gatherers and, in eastern Europe, the early stages in the formation of Bronze Age steppe ancestry. We show that the first farmers of northern and western Europe dispersed through southeastern Europe with limited hunter-gatherer admixture, but that some early groups in the southeast mixed extensively with hunter-gatherers without the sex-biased admixture that prevailed later in the north and west. We also show that southeastern Europe continued to be a nexus between east and west after the arrival of farmers, with intermittent genetic contact with steppe populations occurring up to 2,000 years earlier than the migrations from the steppe that ultimately replaced much of the population of northern Europe.