Syntheses, structures, optical and magnetic properties of Ba2MLnSe5 (M = Ga, In; Ln = Y, Nd, Sm, Gd, Dy, Er).