Fusarium wilt of banana, also recognized as Panama disease, is caused by the soil-borne fungus Fusarium oxysporum f. sp. cubense tropical race 4 (FOC TR4). In recent years, strategies utilizing biocontrol agents, comprising antifungal microorganisms and their associated bioactive compounds from various environments, have been implemented to control this destructive disease. Our previous study showed that Pseudomonas aeruginosa Gxun-2 had significant antifungal effects against FOC TR4. However, there has been little scientific investigation of the antibacterial or antifungal activity. The aim of this study was to isolate, identify and evaluate the inhibition strength of active compounds in P. aeruginosa Gxun-2, so as to explain the mechanism of the strain inhibition on FOC TR4 from the perspective of compounds. The main antibacterial compounds of strain Gxun-2 were isolated, purified and identified using by fermentation extraction, silica gel column chromatography, thin-layer chromatography (TLC), high-performance liquid chromatography (HPLC), and nuclear magnetic resonance (NMR) techniques. The effect of the compounds on the mycelial growth, morphology and spore germination of strain FOC TR4 was observed by 96-well plate method and AGAR diffusion method. Among the metabolites produced by the strain, four antifungal compounds which were identified phenazine (C12H8N2), phenazine-1-carboxylic acid (PCA) (C13H8N2O2), 2-acetamidophenol (C8H9NO2) and aeruginaldehyde (C10H7NO2S) were identified through HPLC and NMR. Of these compounds, phenazine and PCA exhibited the most pronounced inhibitory effects on the spore germination and mycelial growth of FOC TR4. Phenazine demonstrated potent antifungal activity against FOC TR4 with a minimum inhibitory concentration (MIC) of 6.25 mg/L. The half-maximal effective concentration (EC50) was calculated to be 26.24 mg/L using the toxicity regression equation. PCA exhibited antifungal activity against FOC TR4 with an MIC of 25 mg/L and an EC50 of 89.63 mg/L. Furthermore, phenazine and PCA triggered substantial morphological transformations in the mycelia of FOC TR4, encompassing folding, bending, fracturing, and diminished spore formation. These findings indicate that strain Gxun-2 plays a crucial role in controlling FOC TR4 pathogenesis, predominantly through producing the antifungal compounds phenazine and PCA, and possesses potential as a cost-efficient and sustainable biocontrol agent against Fusarium wilt of banana in forthcoming times.