Background: Low-molecular-weight heparins such as enoxaparin are preferred for prevention of venous thromboembolism after major joint replacement. Apixaban, an orally active factor Xa inhibitor, might be as effective, have lower bleeding risk, and be easier to use than is enoxaparin. We assessed efficacy and safety of these drugs after elective total knee replacement. Methods: In ADVANCE-2, a multicentre, randomised, double-blind phase 3 study, patients undergoing elective unilateral or bilateral total knee replacement were randomly allocated through an interactive central telephone system to receive oral apixaban 2·5 mg twice daily (n=1528) or subcutaneous enoxaparin 40 mg once daily (1529). The randomisation schedule was generated by the Bristol-Myers Squibb randomisation centre and stratified by study site and by unilateral or bilateral surgery with a block size of four. Investigators, patients, statisticians, adjudicators, and steering committee were masked to allocation. Apixaban was started 12-24 h after wound closure and enoxaparin 12 h before surgery; both drugs were continued for 10-14 days, when bilateral ascending venography was scheduled. Primary outcome was the composite of asymptomatic and symptomatic deep vein thrombosis, non-fatal pulmonary embolism, and all-cause death during treatment. The statistical plan required non-inferiority of apixaban before testing for superiority; analysis was by intention to treat for non-inferiority testing. The study is registered at ClinicalTrials.gov, number NCT00452530. Findings: 1973 of 3057 patients allocated to treatment (1528 apixaban, 1529 enoxaparin) were eligible for primary efficacy analysis. The primary outcome was reported in 147 (15%) of 976 apixaban patients and 243 (24%) of 997 enoxaparin patients (relative risk 0·62 [95% CI 0·51-0·74]; p<0·0001; absolute risk reduction 9·3% [5·8-12·7]). Major or clinically relevant non-major bleeding occurred in 53 (4%) of 1501 patients receiving apixaban and 72 (5%) of 1508 treated with enoxaparin (p=0·09). Interpretation: Apixaban 2·5 mg twice daily, starting on the morning after total knee replacement, offers a convenient and more effective orally administered alternative to 40 mg per day enoxaparin, without increased bleeding. Funding: Bristol-Myers Squibb; Pfizer.