The nuclear and magnetic structures of several layered mixed copper-transition-metal oxides have been determined from neutron powder diffraction. The nuclear structures of the compounds studied here all consist of apex-linked pyramidal Cu/M-O-5 double layers separated by other structural blocks. These compounds were found to order antiferromagnetically within the Cu/MO planes, but along the apical direction ferromagnetic order occurs provided that the Cu/M ratio is close to unity. The magnetic order can be successfully explained by the electron configuration of the magnetic ions in the compounds: Cud(z2)(2)-O2p(z)-Fe/Cod(z)2(1) interaction favors ferromagnetic ordering along c while d(x)(2-y)(1)2-Op(x,y)-d(x)(2-y2)(1) superexchange results in antiferromagnetic order within the MO planes. In this context, it is found that the above explanation is consistent with the reported magnetic structures of all mixed Cu/Fe or Cu/Co compounds with layered structures.