Rapid identification of the causative agent of hospital-acquired pneumonia (HAP) will allow an earlier administration of a more appropriate antibiotic and could improve the outcome of these patients. The aim of this study was to develop a rapid protocol to identify the main microorganisms involved in HAP by loop-mediated isothermal amplification (LAMP) directly from respiratory samples. First of all, a rapid procedure (<30 min) to extract the DNA from bronchoalveolar lavage (BAL), endotracheal aspirate (EA) or bronchoaspirate (BAS) was set up. A specific LAMP for Staphylococcus aureus, Escherichia coli, Klebsiella pneumoniae, Pseudomonas aeruginosa, Stenotrophomonas maltophilia and Acinetobacter baumannii was performed with the extracted solution at 65 °C for 30–40 min. Overall, 58 positive BAL and 83 EA/BAS samples were tested. The limits of detection varied according to the microorganism detected. Validation of the LAMP assay with BAL samples showed that the assay was 100% specific and 86.3% sensitive (positive predictive value of 100% and a negative predictive value of 50%) compared with culture. Meanwhile for BAS/EA samples, the assay rendered the following statistical parameters: 100% specificity, 94.6% sensitivity, 100% positive predictive value and 69.2% negative predictive value. The turnaround time including sample preparation and LAMP was circa 1 h. LAMP method may be used to detect the most frequent bacteria causing HAP. It is a simple, cheap, sensitive, specific and rapid assay.