  We construct the first examples of finitely presented groups with quadratic
Dehn function containing a finitely generated infinite torsion subgroup. These
examples are "optimal" in the sense that the Dehn function of any such finitely
presented group must be at least quadratic. Moreover, we show that for any
$n\geq2^{48}$ such that $n$ is either odd or divisible by $2^9$, any infinite
free Burnside group with exponent $n$ is a quasi-isometrically embedded
subgroup of a finitely presented group with quadratic Dehn function satisfying
the Congruence Extension Property.
