Land use changes in the northern Mediterranean basin threaten our ability to conserve its habitats and species. Reduced grazing has led to local declines in grassland species and colonization by forest species leading to conservation actions aimed at restoring open habitats. Recently, populations of Gagea lacaitae, a bulbous species typical of Mediterranean open xeric grasslands, have been discovered in forest clearings, an unexpected habitat for this species. Here, we surveyed 48 plots to characterize and compare the ecological niche of G. lacaitae growing in both open xeric and forest clearing habitats. We recorded floristic composition and plant cover and collected soil samples to measure water retention capacity, pH, organic matters and conductivity. Open xeric grasslands and forest clearings differ in plant cover, community composition, and microhabitat structure but not in plant diversity, mean soil conditions, or G. lacaitae cover. Key similarities in conditions allow this species to persist in woodlands that heterogenous enough to include clearings. Such habitats have value for conserving this species and should be sustained.