The main result of this paper is a commutator theorem: If
μ
\mu
and
λ
\lambda
are
A
p
{A_p}
weights, then the commutator
H
H
,
M
b
{M_b}
is a bounded operator from
L
p
(
μ
)
{L^p}(\mu )
into
L
p
(
λ
)
{L^p}(\lambda )
if and only if
b
∈
BMO
(
μ
λ
−
1
)
1
/
p
b \in {\operatorname {BMO} _{{{(\mu {\lambda ^{ - 1}})}^{1/p}}}}
. The proof relies heavily on a weighted sharp function theorem. Along the way, several other applications of this theorem are derived, including a doubly-weighted
L
p
{L^p}
estimate for BMO. Finally, the commutator theorem is used to obtain vector-valued weighted norm inequalities for the Hilbert transform.