This paper proposes a line-interactive fuel-cell-powered uninterruptible-power-supply system. A three-port bidirectional converter connects a fuel cell and a supercapacitor to a grid-interfacing inverter. The system can operate in both stand-alone and grid-connected modes. Moreover, an active filtering function is integrated into the system. It is shown that a supercapacitor can serve as both an active and a reactive energy storage and can buffer the periodical low-frequency ripple in the requested power. For connecting the system to the utility grid, a high-performance single-phase phase-locked loop that incorporates an orthogonal filter is presented. Resonant controllers for both the voltage and current regulations eliminate steady-state error and implement selective harmonic compensation. Simulation and experimental results are provided to show the feasibility of the proposed system and the effectiveness of the control methods.