SARS-CoV-2 Omicron (B.1.1.529) variant is highly transmissible with potential immune escape. We conducted a test-negative case-control study to evaluate mRNA-1273 vaccine effectiveness (VE) against infection and hospitalization with Omicron or Delta. The large, diverse study population included 26,683 SARS-CoV-2 test-positive cases with variants determined by S-gene target failure status (16% Delta, 84% Omicron). The 2-dose VE against Omicron infection at 14-90 days was 44.0% (95% CI, 35.1-51.6%) but declined quickly. The 3-dose VE was 93.7% (92.2-94.9%) and 86.0% (78.1-91.1%) against Delta infection and 71.6% (69.7-73.4%) and 47.4% (40.5-53.5%) against Omicron infection at 14-60 days and >60 days, respectively. The 3-dose VE was 29.4% (0.3-50.0%) against Omicron infection in immunocompromised individuals. The 3-dose VE against hospitalization with Delta or Omicron was >99% across the entire study population. Our findings demonstrate high, durable 3-dose VE against Delta infection but lower effectiveness against Omicron infection, particularly among immunocompromised people. However, 3-dose VE of mRNA-1273 was high against hospitalization with Delta and Omicron variants.