The Scarce Large Blue (Maculinea teleius) is an endangered butterfly throughout Europe due to its special life-cycle and habitat loss. Our aims were to describe the microhabitats available to this butterfly, to test what factors influence the presence and density of M. teleius adults and to investigate the relationship between host ant species and M. teleius. The vicinities of eight fens were sampled, where there are four types of microhabitats available for this butterfly: Narrowleaf Cattail (Typha angustifolia), Purple Loosestrife (Lythrum salicaria), Marsh Woundwort (Stachys palustris) and Purple Moorgrass (Molinia coerulea) dominated vegetation. In five transects (50 × 5 m) around each fen (running from the edge of the fen into the meadows) the number of imagos was counted twice a day during the flight period. Along the transects, the following parameters were measured or assessed: number of flowerheads of foodplant (Sanguisorba officinalis), microhabitat type, grazing intensity, soil humidity, vegetation height and host ant presence. The four microhabitat types differed significantly in soil humidity, vegetation height, foodplant density and distance from a fen. Generally the Typha microhabitat, situated closest to fens, had the highest soil humidity and vegetation height, followed by the Lythrum, Stachys and finally the Molinia microhabitat along a gradient decreasing soil humidity and vegetation height. The foodplant was most abundant in the Lythrum and Stachys microhabitats. Using linear mixed models and forward stepwise manual selection we found that microhabitat type was the most important factor determining the presence of M. teleius. The local grazing intensity had no direct effect but flowerheads of the foodplant had a positive effect on the abundance of butterflies. The number of butterflies was significantly higher in quadrats where the host ant (Myrmica scabrinodis) was present compared to those where they were absent. Our results suggest that grazing should be continued in order to maintain the current distribution of microhabitats and survival of the butterflies.