Patients will be included when they fail a spontaneous ventilation trial (see inclusion criteria) because of marked agitation. Usual simple clinical (respiratory frequency, P01 measured on the respirator, arterial pressure, cardiac rate) and biological criteria (arterial blood gas determination) and a measurement of sedation/agitation with validated scales (Richmond agitation sedation scale, Ramsay score) will be gathered when a patient is deemed ready for a trial of spontaneous ventilation for weaning. In cases of marked agitation according to validated scales, patients will be given a conventional dose (150 mg) of loxapine by the nasogastric tube and the efficacy of this treatment will be evaluated on the same parameters as above. Demonstration of the facilitation of weaning by this simple strategy would be useful in order to reduce risks associated with mechanical ventilation.