One of the major challenges in the real-time control of structures is the uncertainty in identifying the mechanical properties of the system, including mass, stiffness, and damping. However, the presence of uncertainty in time-varying systems (under severe environmental factors, the dynamic characteristics of the system change due to damage) is more noticeable. In this article, to deal with the problem of parametric uncertainties in seismic motion control of structures, an adaptive optimal controller is applied. The design procedure of the controller is straightforward, and there is no need to have the values of the structural parameters. In the proposed scheme, only the states of the system are measured, and it is not necessary to use the ground acceleration data which are difficult to be measured in real time. It is shown that the performance of the designed controller converges to the well-known linear quadratic regulator. Simulation results reveal that considerable reductions of the dynamic responses during the earthquakes are achieved using the utilized adaptive optimal controller, and also it is robust against any variation in the structural parameters due to the damages.