Resonant x-ray diffraction at the L 2-and L 3-absorption edges of Ru has been used to investigate the magnetic structure of Ca 3 Ru 2 O 7 , a material with a bilayer perovskite structure that undergoes a transition from a high-temperature metallic to a low-temperature insulating phase at 48 K. In the insulating phase, magnetic Bragg reflections characteristic of A-type antiferromagnetic order ͑that is, ferromagnetic RuO 2 bilayers coupled antiferromagnetically along the c-axis͒ were identified. The azimuthal-angle dependence of the diffracted intensity implies that the magnetic moments are aligned along the b-axis in the RuO 2 planes. In the metallic phase, the A-type magnetic order persists up to the Néel temperature of 56 K, but the sublattice magnetization decreases by a factor of ϳ1.7 and rotates by 90°within the planes. Resonant signals characteristic of uniform or staggered orbital order were not found within the experimental sensitivity, probably reflecting a weak orbital polarization in the insulating state.