The oncology care process generates a huge amount of information about the evolution of each patient. The analysis of this information is paramount to support oncology research. The unstructured nature of clinical notes, together with the peculiarities of narrative texts, make clinical information extraction a challenge. Moreover, information extraction is one of the most important tasks in the medical domain since performing clinical studies requires commonly detailed information recorded in clinical notes. This paper proposes a deep learning-based approach to extract lung cancer information from clinical notes written in Spanish. This approach exploits two deep learning-based models to perform named entity recognition in the lung cancer domain: Bidirectional Long-Short (BiLSTM) and Bidirectional Encoder Representation for Transformers (BERT). Additionally, we created a manually annotated corpus using clinical notes of patients treated with lung cancer to evaluate this approach. Obtained results show an F-score of 91.08% and 93.72% for BiLSTM and BERT models, respectively. These results show the feasibility of the proposed approach to perform named entity recognition in the lung cancer field.