Pile foundations are generally used to support important industrial buildings, especially located in coastal regions where the major portion is covered by loose soil deposits. They are commonly subjected to lateral dynamic loads mainly due to earthquakes, wind, machineries, and sea waves. Thus, proper analysis and design of pile foundations should be carried out considering soil–pile–structure interaction. In general, the effects of soil–structure interaction are ignored during seismic analysis and design of super-structures. But in reality, the soil-foundation system affects the structural behaviour detrimentally. The main aim of this study was to investigate the effects of soil–pile–structure interaction on the earthquake behaviour of reinforced concrete building frames. Equivalent static analysis was carried out using direct method of approach. A geotechnical finite element program PLAXIS 3D was used for this numerical investigation. Building types ranging from low-rise to high-rise (5 storeys, 10 storeys and 15 storeys), relative densities of sandy soil ranging from loose to dense (30%, 50% and 70%) and spacing of piles ranging from close to large (2D, 4D and 6D) were the parameters considered for this study. The results of pile lateral displacement, rocking of raft foundation, storey lateral displacement and inter-storey drift were obtained for pile supported structure and compared with rigid base structural response. It is observed that soil–pile–structure interaction influences in particular the high-rise structural behaviour significantly. The storey lateral displacements and inter-storey drift values are amplified because of increase in pile lateral displacement and rocking of raft foundation due to increase in number of storeys, reduction in relative density of soil and reduction in spacing of piles. The major effect of soil–pile–structure interaction on storey displacement and inter-storey drift is observed in lower and upper storey levels more particularly in the case of high-rise structures built on loose soil deposit with closely spaced pile foundations. © 2019, Springer Nature Switzerland AG.