Visiting tourists and residents of a city interact at various locations at various times. Previous studies paid little attention to comparing the spatio-temporal behaviours of tourists and residents from a long-term perspective. The aim of the present study was to identify and compare the spatio-temporal behaviours of mainland Chinese tourists and residents in Hong Kong over a period of five years. Their behaviours were compared by means of kernel density analysis and temporal statistical analysis, using Weibo geotagged check-in data and geographic information systems (GIS). The results show that the spatial behaviours of mainland Chinese tourists (MCT) are more concentrated than those of residents, especially in central urban areas, whereas residents also visit suburban and exurban areas. Simultaneously, MCTs' temporal behaviours varied significantly, whereas those of residents were relatively stable. From a long-term perspective, we found that in the central urban area, MCTs' preferences for locations tended to be relatively fixed, but their activity in local neighbourhoods and residential quarters decreased. However, residents' interest in typical tourism highlights decreased reflecting potential strategies of avoidance in those areas whereas their activities in other tourism hotspots were more stable. These findings can be applied in urban planning, destination management and sustainable development.