Increased occurrences of bears in human settlements in search of food have led to a high incidence of human–bear interactions in Japan; therefore, a better understanding of bear occurrence in relation to bears' diet is required to establish effective management practices. In this study, we investigated the composition of the diet of Asiatic black bears (Ursus thibetanus) and the number of bear sightings in Shirakawa Village, Gifu Prefecture, Japan, during pre- and hyperphagic periods (Aug–Dec) from 2008 to 2016. In years with low numbers of sightings, bears consumed natural foods in natural areas, such as fruits of Japanese bird cherry (Prunus grayana), dogwood (Swida controversa), oak (Quercus spp.), and beech (Fagus crenata), which constituted the main part of the bears' diet in our study area. In years with a medium number of sightings, bears consumed both natural and anthropogenic foods in or near human habitations, such as Japanese chestnut (Castanea crenata) and kaki (Diospyros kaki). In the high-sighting year of 2014, bears exhibited a particularly strong preference for Japanese walnut (Juglans mandshurica) and kaki. The number of bear sightings was negatively related to the consumption rates of Japanese bird cherry, dogwood, oak, and beech, and positively related to the consumption rates of Japanese walnut, Japanese chestnut, and kaki. These findings suggest that consumption of fleshy fruits in late summer or hard mast in autumn in or near human settlements has a large effect on the risk of bear–human interactions.