Invasive fungal infections (IFIs) pose a significant threat to immunocompromised individuals, leading to considerable morbidity and mortality. Prompt and accurate diagnosis is essential for effective treatment. Here we develop a rapid molecular diagnostic method that involves three steps: fungal enrichment using affinity-magnetic separation (AMS), genomic DNA extraction with silicon hydroxyl magnetic beads, and detection through a one-pot system. This method, optimized to detect 30 CFU/mL of C. albicans in blood and bronchoalveolar lavage (BAL) samples within 2.5 h, is approximately 100 times more sensitive than microscopy-based staining. Initial validation using clinical samples showed 93.93% sensitivity, 100% specificity, and high predictive values, while simulated tests demonstrated 95% sensitivity and 100% specificity. This cost-effective, highly sensitive technique offers potential for use in resource-limited clinical settings and can be easily adapted to differentiate between fungal species and detect drug resistance.