TALLAHASSEE — Gov. Rick Scott's elections officials showed "a stark pattern of discrimination" in blocking early voting at state college and university campuses, a federal judge ruled Tuesday.

The decision by U.S. District Judge Mark Walker is yet another voting rights defeat for the Republican governor, and could yet emerge as an issue in his campaign to unseat three-term Democratic U.S. Sen. Bill Nelson.

Walker issued a preliminary injunction that directs Scott's chief elections official, Secretary of State Ken Detzner, to tell all 67 counties that they can use campus buildings for early voting this fall. Detzner has until Friday to tell the judge he will obey.

Walker ruled that a 2014 state opinion that banned early voting on campus violates three amendments to the U.S. Constitution.

"Simply put, (the state) opinion reveals a stark pattern of discrimination," Judge Walker wrote. "It is unexplainable on grounds other than age because it bears so heavily on younger voters than on all other voters. (The state's) stated interests for the opinion (following state law, avoiding parking issues, and minimizing on-campus disruption) reek of pretext."

Read the controversial opinion here.

Walker in effect expanded the definition of early voting sites, adding "any such site as may be related to, designed for, affiliated with or part of a college or university."

His 40-page decision said the state's policy had the effect of creating "a secondary class of voters" — college students — who can't vote early in locations where they work, study and live.

"Throwing up roadblocks in front of younger voters does not remotely serve the public interest," Walker wrote. "Abridging voting rights never does."

The judge's order, five weeks before a statewide primary election, is sure to prompt some counties to shuffle their list of early voting sites to include on campus buildings that up to now have been prohibited.

Nelson reacted to the court decision on Twitter, but made no mention of the governor.

Other Democratic politicians also seized on the decision.

The judge noted the growing popularity of early voting in the nation's  third-largest state and that nearly 830,000 students were enrolled at state colleges and universities in 2016, that more than a fourth of the people who voted in 2016 were under age 30, and that early voting is especially popular among college students.

Alachua County Supervisor of Elections Kim Barton said she will reach out to UF to consider early options for the November general election, but it is too late to shift early voting sites for the Aug. 28 primary.

Barton said her duty is "to provide all Alachua County voters equal access to early voting."

Six current or former students at UF and Florida State brought the lawsuit, backed by the Andrew Goodman Foundation and the League of Women Voters of Florida.

"This is truly a victory for the citizens of Florida, especially with so many young people motivated to vote," said League of Women Voters President Patricia Brigham. "This is the right decision, at the right time, for our democratic process … We especially congratulate the students who raised their voices for a fair democracy. These young leaders are a positive example to us all."

Five years ago, the Florida Legislature passed and Scott signed a law that expanded early voting hours and sites. The action was in response to the curtailment of early voting a year earlier in 2012, when President Barack Obama was seeking re-election.

The 2012 law brought widespread denunciations from Democrats and voter advocacy groups who accused Republicans of trying to suppress the vote in 2012.

The 2013 law expanded the definition of early voting sites to include "government-owned community centers."

But when the city of Gainesville asked the state in January 2014 if that definition covered the J. Wayne Reitz Student Union building on the UF campus, the state said no, for one reason: that is was "designed for, and affiliated with, a specific educational institution."

But that interpretation defied logic, Walker reasoned, because the 2013 law allowed early voting at stadiums and libraries — both of which exist on the UF campus.

Walker, who was nominated to the federal bench by Obama in 2012, was first in his class at UF and received his law degree there.

READ MORE: Steve Bousquet column on early voting ban on UF campus

Detzner was the named defendant in the case, but his office issued no comment and referred media requests for comment to Scott's office.

When the lawsuit was filed in May, Scott called it "frivolous" and "an election-year gimmick."

READ MORE: Florida's early voting ban on campus is challenged in court

Scott's office issued a statement that said: "Governor Scott is proud to have signed the largest expansion of early voting in the state's history. We will review this ruling."

Scott's office declined to say whether the state will appeal the decision.

Last November, a 22-year-old recent University of Florida graduate, Megan Newsome, wrote an opinion column in The Gainesville Sun that argued for a solution that was "common sense in nature: Allow public colleges and universities to be early voting locations." The lawsuit soon followed.

Times researcher Caryn Baird contributed to this report.