We conducted a multicenter, placebo-controlled, parallel group, randomized trial at five French ICUs between November 2011 and November 2013. Patients (aged >18 years) under MV for more than 48 hours who were potential candidates for weaning from the ventilator and who exhibited agitation defined by a Richmond Agitation Sedation Scale (RASS) >2 after sedation withdrawal were randomly assigned to receive either loxapine or placebo. All participants were masked to group of allocation. After randomization, patients received 150 mg loxapine or placebo by nasogastric tube. RASS was monitored every 4 hours. A second dose of loxapine or placebo was administered if agitation persisted or worsened. In case of severe agitation, usual sedation (benzodiazepines and morphinic agents) was immediately resumed. Extubation was contemplated when patients were conscious and calm. The primary endpoint was the time between the first administration of loxapine or placebo and successful extubation (no reintubation in the following 48 hours). Three hundred patients were necessary to have 90% power to detect a 2-day reduction of weaning time in the loxapine group with a one-sided type I error rate of 5%.