The United States Supreme Court dealt a substantial setback to conservatives in a key elections case on Monday, ruling 8-0 that lawmakers can count total population, not just eligible voters, in drawing legislative districts.

The case, Evenwel v. Abbott, focused on the so-called "one person, one vote" principle, was brought by Sue Evenwel and Edward Pfenninger, conservative activists who argued that states should count only eligible voters and not total population in devising districts.

A ruling for the plaintiffs would have meant excluding minors, convicted felons and many immigrants — both legal and undocumented — from the population counts used to draw district boundaries.

Because immigrant-heavy districts tend to be more urban and Democratic-leaning, civil rights activists and liberal groups weighed in strongly against the plaintiffs' case. A ruling in the plaintiffs' favor would have diluted the power of predominantly Democratic areas.

Justice Ruth Bader Ginsburg wrote the court's majority opinion, which was joined by five other justices. Justices Clarence Thomas and Samuel Alito, both conservatives, concurred with the court's ruling but did not join Ginsburg's opinion.

Citing "constitutional history, the court's decisions and longstanding practice," Ginsburg rejected the notion that the "one person, one vote" principle required counting only eligible voters.

"Total-population apportionment meets the equal protection demand, by rendering each representative alert to the interests and constituent-service requests of all who dwell in the representative's district," she wrote.

Meanwhile, Thomas and Alito argued that individual states should be allowed to decide how to draw district boundaries.