An improved potential mean force (PMF) scoring function, named KScore, has been developed by using 23 redefined ligand atom types and 17 protein atom types, as well as 28 newly introduced atom types for nucleic acids (DNA and RNA). Metal ions and water molecules embedded in the binding sites of receptors are considered explicitly by two newly defined atom types. The individual potential terms were devised on the basis of the high-resolution crystal and NMR structures of 2,422 protein-ligand complexes, 300 DNA-ligand complexes, and 97 RNA-ligand complexes. The optimized atom pairwise distances and minima of the potentials overcome some of the disadvantages and ambiguities of current PMF potentials; thus, they more reasonably explain the atomic interaction between receptors and ligands. KScore was validated against five test sets of protein-ligand complexes and two sets of nucleic-acid-ligand complexes. The results showed acceptable correlations between KScore scores and experimentally determined binding affinities (log K i's or binding free energies). In particular, KScore can be used to rank the binding of ligands with metalloproteins; the linear correlation coefficient ( R) for the test set is 0.65. In addition to reasonably ranking protein-ligand interactions, KScore also yielded good results for scoring DNA/RNA--ligand interactions; the linear correlation coefficients for DNA-ligand and RNA-ligand complexes are 0.68 and 0.81, respectively. Moreover, KScore can appropriately reproduce the experimental structures of ligand-receptor complexes. Thus, KScore is an appropriate scoring function for universally ranking the interactions of ligands with protein, DNA, and RNA.