Background: Lung adenocarcinoma (LUAD) with Pulmonary arterial hypertension (PAH) shows a poor prognosis. Detecting related genes is imperative for prognosis prediction. Methods: The gene expression profiles of LUAD and PAH were acquired from The Cancer Genome Atlas (TCGA) and the Gene Expression Omnibus (GEO) database, respectively. The co-expression modules associated with LUAD and PAH were evaluated using the Weighted Gene Co-Expression Network Analysis (WGCNA). The relationship between key gene expression with immune-cell infiltration and the tumor immune microenvironment (TIME) was evaluated. We confirmed the mRNA and protein levels in vivo and vitro. G6PD knockdown was used to conduct the colony formation assay, transwell invasion assay, and scratch wound assay of A549 cells. EDU staining and CCK8 assay were performed on G6PD knockdown HPASMCs. We identified therapeutic drug molecules and performed molecular docking between the key gene and small drug molecules. Results: Three major modules and 52 overlapped genes were recognized in LUAD and PAH. We identified the key gene G6PD, which was significantly upregulated in LUAD and PAH. In addition, we discovered a significant difference in infiltration for most immune cells between high-and low-G6PD expression groups. The mRNA and protein expressions of G6PD were significantly upregulated in LUAD and PAH. G6PD knockdown decreased proliferation, cloning, and migration of A549 cells and cell proliferation in HPASMCs. We screened five potential drug molecules against G6PD and targeted glutaraldehyde by molecular docking. Conclusions: This study reveals that G6PD is an immune-related biomarker and a possible therapeutic target for LUAD and PAH patients.