This invention relates to a purine or pyrimidine phosphonate compound of formula (I) or pharmaceutically acceptable salt thereof; wherein B, X, and R1-R3 are as defined in classes and subclasses herein. These compounds may be used as antiviral precursors. The invention also relates to therapeutic compositions of these compounds and their use for the preparation of a medication for testing and/or preventing a viral infection in a patient. The invention also provides methods for making these compounds. In particular, the invention provides an H-phosphinate precursor intermediate of formula (II) wherein B is a purine or pyrimidine base as defined herein and R1 is selected from the group comprising a hydrogen atom, and a methyl, ethyl, hydroxymethyl, hydroxyethyl and C1-6haloalkyl group.