  The classification of the finite primitive permutation groups of rank $3$ was
completed in the 1980s and this landmark achievement has found a wide range of
applications. In the general transitive setting, a classical result of Higman
shows that every finite imprimitive rank $3$ permutation group $G$ has a unique
non-trivial block system $\mathcal{B}$ and this provides a natural way to
partition the analysis of these groups. Indeed, the induced permutation group
$G^{\mathcal{B}}$ is $2$-transitive and one can also show that the action
induced on each block in $\mathcal{B}$ is also $2$-transitive (and so both
induced groups are either affine or almost simple). In this paper, we make
progress towards a classification of the rank $3$ imprimitive groups by
studying the case where the induced action of $G$ on a block in $\mathcal{B}$
is of affine type. Our main theorem divides these rank $3$ groups into four
classes, which are defined in terms of the kernel of the action of $G$ on
$\mathcal{B}$. In particular, we completely determine the rank $3$
semiprimitive groups for which $G^{\mathcal{B}}$ is almost simple, extending
recent work of Baykalov, Devillers and Praeger. We also prove that if $G$ is
rank $3$ semiprimitive and $G^{\mathcal{B}}$ is affine, then $G$ has a regular
normal subgroup which is a special $p$-group for some prime $p$.
