  We prove that every JBW$^*$-triple $M$ with rank one or rank bigger than or
equal to three satisfies the Mazur--Ulam property, that is, every surjective
isometry from the unit sphere of $M$ onto the unit sphere of another Banach
space $Y$ extends to a surjective real linear isometry from $M$ onto $Y$. We
also show that the same conclusion holds if $M$ is not a JBW$^*$-triple factor,
or more generally, if the atomic part of $M^{**}$ is not a rank two Cartan
factor.
