WASHINGTON — Voter-identification laws are suddenly in peril.

In agreeing last week to relax its voter-ID requirements for the November election, Texas showed how far the legal climate has shifted with respect to the wave of state laws enacted over the past decade. The agreement came less than two weeks after a federal appeals court said the ID law in Texas was racially discriminatory.

Just two years ago, a divided Supreme Court let the Texas law take effect for the 2014 election. That was before Justice Antonin Scalia’s death left the high court without a reliable majority to uphold ID laws.

It was also before opponents in some lawsuits had a chance to marshal their evidence against the measures. With evidence in hand, courts also blocked voting requirements of various types in North Carolina, Wisconsin, North Dakota and Ohio over the past two weeks.

“The last week or so has demonstrated that the tide has turned on these cases,” said Danielle Lang, a lawyer with the Campaign Legal Center in Washington and part of the legal team that fought the Texas law. “Litigants and advocates have built really strong records to demonstrate the burdens of these laws.”

Even with the latest rulings, 15 states will have new voting restrictions for the first time in a presidential election this year, according to New York University School of Law’s Brennan Center for Justice, which opposes many of the changes. Supporters of the measures say they are valuable tools to prevent voter fraud.

Without them, “we may have people vote 10 times,” Republican presidential nominee Donald Trump told The Washington Post last week. “It’s inconceivable that you don’t have to show identification in order to vote or that the identification doesn’t have to be somewhat foolproof.”

Federal judges increasingly are disagreeing with that stance. A federal appeals court said North Carolina’s requirements, which also include restrictions on early voting and same-day registration, “target African-Americans with almost surgical precision.”

A different federal appeals court, the generally conservative 5th U.S. Circuit Court of Appeals, said Texas’ ID law had a disproportionate effect on racial minorities. A trial judge had found that more than 600,000 Texans, including a disproportionate number of blacks and Hispanics, lacked one of the forms of identification required under the law.

The measure lets voters use driver’s licenses, military IDs and concealed-handgun permits, but not student or employee IDs.

Under the state’s agreement with the Obama administration and voting-rights advocates, people lacking one of the required IDs will have more options in November. They will now be able to provide voter registration cards, certified birth certificates, utility bills, government checks, pay stubs or bank statements with their names and addresses on them.

“The agreement fully protects the citizens of Texas,” Lang said.

Rick Pildes, an election-law scholar who teaches at New York University School of Law, said that although Scalia’s death might change the dynamics on the Supreme Court, it’s not the reason the laws are being struck down.

Even before the recent burst of decisions, judges had begun to strike down or soften voter-ID laws in lower-profile decisions, he said.

“The cases are being much better litigated, with more extensive factual records being developed to identify the number and types of eligible voters who do not possess the required forms of photo identification,” Pildes said.