  We constructed, by the first-principles calculations, a magnetic phase
diagram of Sr$_{2}$RuO$_4$ in the space spanned by structural distortions. Our
phase diagram can qualitatively explain the experimental one for
Ca$_{2-x}$Sr$_x$RuO$_4$. We found that the rotation and the tilting of RuO$_6$
octahedron are responsible for the ferro- and antiferro-magnetism,
respectively, while the flattening of RuO$_6$ is the key factor to stabilize
those magnetic ground states. Our results imply that the magnetic and the
structural instabilities in Sr$_2$RuO$_4$ are closely correlated cooperatively
rather than competitively.
