Inrush current refers to the high-magnitude excitation current drawn by a transformer upon energization. The intensity of inrush current is a function of the residual flux of the transformer's core and the voltage magnitude at the energization instant. This paper proposes a method to effectively mitigate the inrush current of single-phase transformers. The proposed method overcomes the shortcomings of the well-established pre-fluxing method, and thus, is referred to as the modified pre-fluxing method. The method operates without requiring any prior knowledge regarding the transformer's design information or parameters. Accounting for uncertainties in circuit breaker closing operation, the core's residual flux is modified to an appropriate reference value, minimizing the corresponding adverse impact. The flux adjustment is accomplished by a power electronic circuitry that applies suitable voltage across the transformer's low-voltage winding. The core's residual flux is estimated after removing the DC offset present in the measured open-circuit voltage. The energization process is then initiated at an appropriate instant ensuring the core's steady-state flux matches its adjusted residual flux. The efficiency of the modified pre-fluxing method is demonstrated by conducting 12,000 simulations in PSCAD/EMTDC. A hardware-in-the-loop (HIL) setup composed of a transformer and pre-fluxing device is used for extensive experimental validation and comparison with recent energization methods under more realistic conditions.