Agricultural intensification has affected wildlife across Europe, triggering steep declines and regional extinctions of farmland birds. Effective conservation activities are essential for the preservation of biodiversity in an agricultural landscape, but current efforts have not succeeded in halting these declines. Here we investigate a ground-nesting shorebird, the collared pratincole Glareola pratincola, which has shifted its habitat use in Central Europe over the last 20 years from alkaline grasslands to intensively managed agricultural fields. We show that nesting success was different between three agricultural habitat types, with the highest nesting success in fallow lands and the lowest in row crops. Nesting success was also associated with the timing of breeding and breeding density, as nests produced early in the breeding season and those in high-breeding-density areas hatched more successfully than those produced later in the season and at low density. We implemented direct conservation measures including marking nests and negotiating with farmers to avoid cultivating the field between nest markers, controlling nest predators and, most recently, creating suitable nesting sites and foraging areas for pratincoles. As a result of these conservation actions, nest survival increased from 11.2% to 83.5% and the size of the breeding population increased from 13 to 56 pairs during 2012–2021. Thus, we show that agricultural landscapes can continue to provide suitable habitats, and targeted conservation actions have the potential to reverse the declines of farmland species.