The effect of parathyroid hormone (PTH) on the production of osteoprotegerin (OPG) and ligand of receptor activator of NF-kappaB (RANKL) in human bone is incompletely understood. Most in vitro studies indicate that PTH decreases OPG and increases RANKL production. In primary hyperparathyroidism (PHPT), hypersecretion of PTH leads to enhanced bone resorption and formation with increased risk of fracture. Decreasing PTH levels by surgery normalizes bone metabolism, but the effects on skeletal OPG and RANKL production are unknown. In this study, 24 patients referred to our clinic for evaluation, and treatment of PHPT were included. A transiliac bone biopsy was done before (n = 24) and 12 months after parathyroidectomy (PTX) (n = 21). Biopsies were frozen in liquid nitrogen and RNA extracted using Trizol. A competitive RT-PCR assay for RANKL and OPG mRNA using artificial cDNA standards was developed and used for quantification. Results were normalized for GAPDH mRNA content. Before surgery, the RANKL/GAPDH gene expression ratio showed positive correlations with serum osteocalcin (r = 0.42, P <0.05) and urinary NTX (r = 0.43, P <0.05). The OPG/GAPDH mRNA levels in iliac bone before surgery correlated with serum osteocalcin (r = 0.52, P <0.01), but not with bone resorption markers. The mRNA ratio of RANKL/OPG decreased significantly (P <0.05) after surgery. In conclusion, RANKL and OPG gene expression within the human bone microenvironment are influenced by PTH, as the ratio RANKL/OPG decreased upon PTX. In addition, locally produced RANKL appears to affect bone turnover in the hyperparathyroid state.