Background: The molecular profiling of patients with advanced non-small-cell lung cancer (NSCLC) for known oncogenic drivers is recommended during routine care. Nationally, however, the feasibility and effects on outcomes of this policy are unknown. We aimed to assess the characteristics, molecular profiles, and clinical outcomes of patients who were screened during a 1-year period by a nationwide programme funded by the French National Cancer Institute. Methods This study included patients with advanced NSCLC, who were routinely screened for EGFR mutations, ALK rearrangements, as well as HER2 (ERBB2), KRAS, BRAF, and PIK3CA mutations by 28 certified regional genetics centres in France. Patients were assessed consecutively during a 1-year period from April, 2012, to April, 2013. We measured the frequency of molecular alterations in the six routinely screened genes, the turnaround time in obtaining molecular results, and patients' clinical outcomes. This study is registered with ClinicalTrials.gov, number NCT01700582. Findings 18 679 molecular analyses of 17 664 patients with NSCLC were done (of patients with known data, median age was 64·5 years [range 18–98], 65% were men, 81% were smokers or former smokers, and 76% had adenocarcinoma). The median interval between the initiation of analysis and provision of the written report was 11 days (IQR 7–16). A genetic alteration was recorded in about 50% of the analyses; EGFR mutations were reported in 1947 (11%) of 17 706 analyses for which data were available, HER2 mutations in 98 (1%) of 11 723, KRAS mutations in 4894 (29%) of 17 001, BRAF mutations in 262 (2%) of 13 906, and PIK3CA mutations in 252 (2%) of 10 678; ALK rearrangements were reported in 388 (5%) of 8134 analyses. The median duration of follow-up at the time of analysis was 24·9 months (95% CI 24·8–25·0). The presence of a genetic alteration affected first-line treatment for 4176 (51%) of 8147 patients and was associated with a significant improvement in the proportion of patients achieving an overall response in first-line treatment (37% [95% CI 34·7–38·2] for presence of a genetic alteration vs 33% [29·5–35·6] for absence of a genetic alteration; p=0·03) and in second-line treatment (17% [15·0–18·8] vs 9% [6·7–11·9]; p<0·0001). Presence of a genetic alteration was also associated with improved first-line progression-free survival (10·0 months [95% CI 9·2–10·7] vs 7·1 months [6·1–7·9]; p<0·0001) and overall survival (16·5 months [15·0–18·3] vs 11·8 months [10·1–13·5]; p<0·0001) compared with absence of a genetic alteration. Interpretation Routine nationwide molecular profiling of patients with advanced NSCLC is feasible. The frequency of genetic alterations, acceptable turnaround times in obtaining analysis results, and the clinical advantage provided by detection of a genetic alteration suggest that this policy provides a clinical benefit.