The crystalline and magnetic structures of Ca2Ru1−xFexO4 (x=0.02, 0.05, 0.08 and 0.12) have been studied using neutron and X-ray diffraction. The Fe-doping reduces the Ru-O bond length in both apical and planar directions. The smaller Ru(Fe)O6 octahedron leads to its reduced distortion. The P bca space group is maintained in all the Fe-dopings, so is the octahedral flattening. Warming has a similar effect on the lattice to that of the Fe-doping in releasing the distorted octahedra but precipitates an abrupt octahedral elongation near the Néel temperature. Two competing antiferromagnetic orders, A-and B-centered phases have been observed. The Fe-doping-relaxed crystal structure prefers the latter to the former. As the doping increases, the B-centered phase continuously grows at the cost of the A-centered one and eventually replaces it at x=0.12. The absence of the two-dimensional antiferromagnetic critical fluctuations above the magnetic transition temperature and the three-dimensional magnetic correlation below the transition, together with the anomalous lattice response, point to an important role of orbital degree of freedom in driving the magnetic phase competition.