DETROIT — A federal judge ruled Wednesday that Michigan can't eliminate straight-party voting, saying that preventing voters from checking a single box to vote for all of a party's candidates would lead to long lines at the polls and discriminate against blacks, who tend to use the straight-party option at a higher rate.

The ruling from U.S. District Judge Gershwin Drain in Detroit was a victory for the A. Philip Randolph Institute, which sued Michigan Secretary of State Ruth Johnson to overturn the ban that the Republican-led Legislature passed in late 2015.

Jerry King, who heads the Detroit-area chapter of the institute, a Washington-based organization that advocates on behalf of workers' rights and civil rights, lauded the ruling. He told The Associated Press that the Republican push to get rid of straight-party voting was part of a "continuous step to undermine working-class people."

"I'm happy our leadership took on this fight," King said.

Johnson's office didn't immediately reply to a call seeking comment about the ruling.

Drain issued an injunction that stopped the ban from being in effect for the November 2016 election, when nearly half of Michigan voters used the straight-party option. Straight-party voting is popular in urban areas that typically vote Democratic, such as Detroit and Flint. But it was also common in Republican-friendly counties won by President Donald Trump, such as Ottawa, Allegan, Livingston and Kent.

Gov. Rick Snyder and other Republicans have said the ban will inspire voters to do their homework instead of simply choosing a party.

But Drain wrote that Michigan's Republican-controlled Legislature "intentionally discriminated against African-Americans in violation of the Equal Protection Clause" of the U.S. Constitution. He also said the ban violated the federal Voting Rights Act and pointed out that Michigan voters defeated attempts to end straight-ticket voting in 1964 and 2001.

Karen Hobert Flynn, the president of Common Cause, which joined in the lawsuit along with some black voters, called it a "big win for Michigan voters."

"The evidence in this case and Judge Drain's decision makes clear that the Michigan legislature intentionally discriminated against African Americans for partisan political purposes," she said in a news release.

Other states recently have taken on "straight-party" or "straight-ticket" voting.

In Iowa, which has a Republican-led Legislature and governor, a new voter ID law eliminated an option for straight-ticket voting for one political party. Last year in Texas, where Republicans are also in charge, lawmakers approved eliminating straight-ticket voting beginning in September 2020.

Democratic New Mexico Secretary of State Maggie Toulouse Oliver said earlier this year that she wants to restore straight-ticket voting in time for fall elections. The option was removed beginning in the 2012 elections.

