We used a combination of density functional theory (DFT) calculations and the implicit quantization of the acidic N-H and O-H bonds to assess the effect of deuteration on the binding of agonists (2-methylhistamine and 4-methylhistamine) and antagonists (cimetidine and famotidine) to the histamine H2 receptor. The results show that deuteration significantly increases the affinity for 4-methylhistamine and reduces it for 2-methylhistamine, while leaving it unchanged for both antagonists, which is found in excellent agreement with experiments. The revealed trends are interpreted in the light of the altered strength of the hydrogen bonding upon deuteration, known as the Ubbelohde effect, which affects ligand interactions with both active sites residues and solvent molecules preceding the binding, thus providing strong evidence for the relevance of hydrogen bonding for this process. In addition, computations further underline an important role of the Tyr250 residue for the binding. The obtained insight is relevant for the therapy in the context of (per)deuterated drugs that are expected to enter therapeutic practice in the near future, while this approach may contribute towards understanding receptor activation and its discrimination between agonists and antagonists.