In this paper, an attempt is made to examine a new method for designing and applying the active vibration control system to improve building performance under mainshock-aftershock sequences. In this regard, three different structures are considered; 5-, 10-, and 15-story buildings. Seven mainshock-aftershock sequences are selected from the Iranian accelerogram database for analyzing the structures. By implementing an advanced two-step optimization method, buildings equipped with the active vibration control system (linear-quadratic regulator (LQR) algorithm) are designed to withstand all events of mainshock-aftershock sequences. In the first optimization step, a multi-objective optimization with the genetic algorithm is performed and a set of optimal Pareto front results is obtained. In the next step, the life-cycle cost of each optimal design sample of the Pareto front is calculated by considering the cumulative damage and the design sample with the minimum cost is selected as a final optimal property. The results prove that the active vibration control system is capable of reducing structural responses, including acceleration, drift, and residual drift under mainshock-aftershock sequences, and consequently the life-cycle cost of buildings, especially the taller ones. In addition, obtaining the building design variables (story stiffness and yielding force) and active LQR algorithm properties simultaneously leads to a slightly softer final building model than the conventional structure designed by the common building design code. Moreover, it is revealed that, by considering the aftershocks, the building life-cycle cost increases significantly.