  Let $\mathbb{D}$ be a division ring and $\mathbb{F}$ be a subfield of the
center of $\mathbb{D}$ over which $\mathbb{D}$ has finite dimension $d$. Let
$n,p,r$ be positive integers and $\mathcal{V}$ be an affine subspace of the
$\mathbb{F}$-vector space $M_{n,p}(\mathbb{D})$ in which every matrix has rank
less than or equal to $r$. Using a new method, we prove that $\dim_{\mathbb{F}}
\mathcal{V} \leq \max(n,p)\,rd$ and we characterize the spaces for which
equality holds. This extends a famous theorem of Flanders which was known only
for fields.
