In this study, the seismic performance of a 20-storey steel structure with a mat foundation located on layered soil is investigated under an array of strong ground excitations, which includes 6 far-fault and 6 near-fault earthquakes. Eight different modes for soil layering have been considered in the numerical simulation. FLAC 2D nonlinear platform has been used to model the near-realistic behavior. To this end, hundred lines of codes and subroutines have been developed in this platform to perform the analysis. The results of the analyzes include the absolute displacement of the floors, the ratio of the relative displacement of the floors, the shear force, the axial force, and the bending moment of the columns. It was concluded that for a 20-story structure on a mat foundation under both far-field and near-field earthquakes, the most reliable type of soil is the dense sandy soil and the most critical case is the soft clay soil. It was also observed that the near-field strong ground motions have imposed more critical structural responses compared to far-field records.