  A characterization of the finite-dimensional Leibniz algebras with an abelian
subalgebra of codimension two over a field $\mathbb{F}$ of characteristic
$p\neq2$ is given. In short, a finite-dimensional Leibniz algebra of dimension
$n$ with an abelian subalgebra of codimension two is solvable and contains an
abelian ideal of codimension at most two or it is a direct sum of a Lie
one-dimensional solvable extension of the Heisenberg algebra
$\mathfrak{h}(\mathbb{F})$ and $\mathbb{F}^{n-4}$ or a direct sum of a
$3$-dimensional simple Lie algebra and $\mathbb{F}^{n-3}$ or a Leibniz
one-dimensional solvable extension of the algebra $\mathfrak{h}(\mathbb{F})
\oplus \mathbb{F}^{n-4}$.
