WASHINGTON- The U.S. Supreme Court ruled on Monday for AT&T Inc in a dispute over how retirement benefits should be calculated for women who took maternity leaves before the federal Pregnancy Discrimination Act took effect in 1979.

By a 7-2 vote, the justices overturned a U.S. appeals court ruling that AT&T had violated federal civil rights law by not granting women credit for their entire pregnancy-related leaves taken before 1979.

The 1979 law barred companies from treating pregnancy leaves differently from other disability leaves. Since then, maternity leave has been considered disability leave and has been credited toward retirement. (Reporting by James Vicini, Editing by Gerald E. McCormick)