Owing to its capacity for reversible hydrogen storage, formic acid (FA) holds great promise as an energy carrier alternative to conventional fossil fuels systems. While the decomposition of FA to hydrogen (H2) and carbon dioxide (CO2) through homogeneous catalysis has been well-established, the selective and efficient dehydrogenation of FA by a robust heterogeneous catalyst remains a challenge. Herein, a novel heterogeneous ruthenium-pincer framework with single-atomic sites was prepared in one step by the direct knitting of a phosphorous-nitrogen PN3P-pincer ruthenium complex in a porous organic polymer. The heterogeneous ruthenium complex efficiently dehydrogenates formic acid in both organic and aqueous media with remarkably enhanced stability. Notably, no detectible CO was generated and a turnover number of 145,300 was attained in a continuous experiment with no significant decline in catalytic reactivity (in sharp contrast, total TON of only 5,600 was obtained with the homogeneous analog under the same conditions). The single-atomic sites in the porous framework allowed the combination of the desirable attributes of high reactivity and selectivity of a homogeneous catalyst with the significantly enhanced catalyst stability and reusability benefits of heterogeneous catalysis.