We show that a linear subspace of a reductive Lie algebra $\operatorname{\mathfrak g}$ that consists of nilpotent elements has dimension at most $\frac{1}{2}(\dim\operatorname{\mathfrak g}-\operatorname{rk}\operatorname{\mathfrak g})$, and that any nilpotent subspace attaining this upper bound is equal to the nilradical of a Borel subalgebra of $\operatorname{\mathfrak g}$. This generalizes a classical theorem of Gerstenhaber, which states this fact for the algebra of $(n\times n)$-matrices.