The method and system according to preferred embodiments of the present invention allows an effective breath-synchronized delivery of atomized liquid medicament (e.g. a pulmonary surfactant) to the patient's lungs. According to a preferred embodiment, the method of the present invention provides an efficient delivery of the aerosol medicament, controlling the behavior of the infusion pump to make the rising and falling time faster even though the intrinsic time constant of the system is long. Additionally, in an embodiment of the present invention, at the same time the information about the breathing activity contained either directly on the surfactant line or stored in the controller action can be used to extrapolate the breathing pattern.