  We study the most general supersymmetric warped M-theory backgrounds with
non-trivial G-flux of the type R^{1,2} x M_8 and AdS_3 x M_8. We give a set of
necessary and sufficient conditions for preservation of supersymmetry which are
phrased in terms of G-structures and their intrinsic torsion. These equations
may be interpreted as calibration conditions for a static ``dyonic'' M-brane,
that is, an M5-brane with self-dual three-form turned on. When the electric
flux is turned off we obtain the supersymmetry conditions and non-linear PDEs
describing M5-branes wrapped on associative and special Lagrangian three-cycles
in manifolds with G_2 and SU(3) structures, respectively. As an illustration of
our formalism, we recover the 1/2-BPS dyonic M-brane, and also construct some
new examples.
