We give necessary and sufficient conditions in order that the Hardy op
erator is bounded from an arbitrary weighted Banach function space (X,
v) into L(infinity) or weighted BMO. Moreover, we give necessary and
sufficient conditions in order that the Hardy operator is compact from
(X, v) into L(infinity) or non-weighted BMO. Applications to the case
of weighted BMO are discussed as well.