We assessed the effectiveness of celecoxib in the prevention of heterotopic ossification (HO) following primary total hip replacement (THR). We studied 170 consecutive THRs. Sixty-three patients received celecoxib after surgery (200 mg twice/daily) for 28 days and 84 did not. HO was more common in non-celecoxib patients than in the celecoxib-group at 3, 6, and 12 months (P = 0.005, 0.004 and 0.01, respectively). At 1 year, fewer celecoxib recipients had Brooker classes II or III. None of the celecoxib patients developed HO Brooker class IV, while 2% in the non-celecoxib group did. No patient discontinued treatment or had revision for aseptic loosening. A short course of celecoxib for pain aids in the prevention of HO after primary THR, and could be a useful and safe option that does not interfere with anticoagulation.