The present study developed a DNA biosensor to determine pemigatinib for the first time. Three-dimensional carnation flower-like Eu3+:β-MnO2 nanostructures (3D CF-L Eu3+:β-MnO2 NSs) and a screen-printed electrode (SPE) modified with polyaniline (PA) were employed. The double-stranded DNA was also immobilized completely on the PA/3D CF-L Eu3+:β-MnO2 NSs/SPE. Then, electrochemical techniques were used for characterizing the modified electrode. After that, the interaction between pemigatinib and DNA was shown by a reduction in the oxidation current of guanine using differential pulse voltammetry (DPV). According to the analysis, the dynamic range of pemigatinib was between 0.001 and 180.0 μM, indicating the new electrode has a low limit of detection (LOD = 0.23 nM) for pemigatinib. Afterwards, pemigatinib in real samples was measured using the PA/3D CF-L Eu3+:β-MnO2 NSs/SPE loaded with ds-DNA. The proposed DNA biosensor showed good selectivity toward pemigatinib in the presence of other interference analytes, such as other ions, structurally related pharmaceuticals, and plasma proteins. In addition, the interaction site of pemigatinib with DNA was predicted by molecular docking, which showed the interaction of pemigatinib with the guanine bases of DNA through a groove binding mode. Finally, we employed the t-test to verify the capability of the ds-DNA/PA/3D CF-L Eu3+:β-MnO2 NSs/SPE for analyzing pemigatinib in real samples.