Lyme borreliosis (LB) is the most prevalent tick-borne human infection in Europe, with increasing incidence during the latest decades. Abundant populations of Ixodes ricinus, the main vector of the causative agent, spirochetes from the Borrelia burgdorferi sensu lato (Bbsl) complex, have been observed in urban and suburban areas of Europe, in general, and Slovakia, particularly. Understanding the spread of infectious diseases is crucial for implementing effective control measures. Global changes affect contact rates of humans and animals with Borrelia-infected ticks and increase the risk of contracting LB. The aim of this study was to investigate spatial and temporal variation in prevalence of Bbsl and diversity of its species in questing I. ricinus from three sites representing urban/suburban, natural and agricultural habitat types in Slovakia. Ixodes ricinus nymphs and adults were collected by dragging the vegetation in green areas of Bratislava town (urban/suburban habitat), in the Small Carpathians Mountains (natural habitat) (south-western Slovakia) and in an agricultural habitat at Rozhanovce in eastern Slovakia. Borrelia presence in ticks was detected by PCR and Bbsl species were identified by restriction fragment length polymorphism (RFLP). Borrelia burgdorferi s.l. species in coinfected ticks were identified by reverse line blot. Significant spatial and temporal variability in prevalence of infected ticks was revealed in the explored habitats. The lowest total prevalence was detected in the urban/suburban habitat, whereas higher prevalence was found in the natural and agricultural habitat. Six Bbsl species were detected by RFLP in each habitat type -B. burgdorferi sensu stricto (s.s.), B. afzelii, B. garinii, B. valaisiana, B. lusitaniae and B. spielmanii. Coinfections accounted for 3% of the total infections, whereby B. kurtenbachii was identified by RLB and sequencing in mixed infection with B. burgdorferi s.s, B. garinii and B. valaisiana. This finding represents the first record of B. kurtenbachii in questing I. ricinus in Slovakia and Europe. Variations in the proportion of Bbsl species were found between nymphs and adults, between years and between habitat types. Spatial variations in prevalence patterns and proportion of Bbsl species were also confirmed between locations within a relatively short distance in the urban habitat. Habitat-related and spatial variations in Borrelia prevalence and distribution of Bbsl species are probably associated with the local environmental conditions and vertebrate host spectrum. Due to the presence of Borrelia species pathogenic to humans, all explored sites can be ranked as areas with high epidemiological risk.