The so-called drag-based model (DBM) simulates analytically the propagation of coronal mass ejections (CMEs) in interplanetary space and allows the prediction of their arrival times and impact speeds at any point in the heliosphere ("target"). The DBM is based on the assumption that beyond a distance of about 20 solar radii from the Sun, the dominant force acting on CMEs is the "aerodynamic" drag force. In the standard form of DBM, the user provisionally chooses values for the model input parameters, by which the kinematics of the CME over the entire Sun-"target" distance range is defined. The choice of model input parameters is usually based on several previously undertaken statistical studies. In other words, the model is used by ad hoc implementation of statistics-based values of the input parameters, which are not necessarily appropriate for the CME under study. Furthermore, such a procedure lacks quantitative information on how well the simulation reproduces the coronagraphically observed kinematics of the CME, and thus does not provide an estimate of the reliability of the arrival prediction. In this paper we advance the DBM by adopting it in a form that employs the CME observations over a given distance range to evaluate the most suitable model input parameters for a given CME by means of the least-squares fitting. Furthermore, the new version of the model automatically responds to any significant change of the conditions in the ambient medium (solar wind speed, density, CME-CME interactions, etc.) by changing the model input parameters according to changes in the CME kinematics. The advanced DBM is shaped in a form that can be readily employed in an operational system for real-time space-weather forecasting by promptly adjusting to a successively expanding observational dataset, thus providing a successively improving prediction of the CME arrival.-3 -