Physics-based force fields for ligand-protein docking usually determine electrostatic energy with distance-dependent dielectric (DDD) functions, which do not fully account for the dielectric permittivity variance between approximately 2 in the protein core and approximately 80 in bulk water. Here we propose an atom-atom solvent exposure- and distance-dependent dielectric (SEDDD) function, which accounts for both electrostatic and dehydration energy components. Docking was performed using the ZMM program, the AMBER force field, and precomputed libraries of ligand conformers. At the seeding stage, hundreds of thousands of positions and orientations of conformers from the libraries were sampled within the rigid protein. At the refinement stage, the ten lowest-energy structures from the seeding stage were Monte Carlo-minimized with the flexible ligand and flexible protein. A search was considered a success if the root mean square deviation (RMSD) of the ligand atoms in the apparent global minimum from the x-ray structure was <2 A. Calculations on an examining set of 60 ligand-protein complexes with different DDD functions and solvent-exclusion energy revealed outliers in most of which the ligand-binding site was located at the protein surface. Using a training set of 16 ligand-protein complexes, which did not overlap with the examining set, we parameterized the SEDDD function to minimize the RMSD of the apparent global minima from the x-ray structures. Recalculation of the examining set with the SEDDD function demonstrated a 20% increase in the success rate versus the best-performing DDD function.