State Sen. Ted Lieu on Monday introduced a bill that would bar California agencies and officials from cooperating with federal authorities seeking electronic records on a state resident, unless the government first obtains a warrant.

An influential legal scholar, however, says the bill, if enacted, would never survive a court challenge.

The South Bay Democrat said he is reacting to news reports on what he calls an overreach by the National Security Agency. The spy agency, according to reports, has been compiling phone and Internet data on American citizens within the United States. In many cases, the agency obtains the data without a warrant and with the help of cooperating entities. Under Lieu’s proposed legislation, however, the state would not assist the federal government.

Lieu’s anti-NSA stance is shared by many civil libertarians, who believe the program is improper. But it is likely an issue for Congress, not individual states, experts say.

“I share Senator Lieu’s concerns over NSA surveillance,” said Erwin Chemerinsky , dean of the School of Law at UC Irvine. “But California cannot stop it or interfere with it since it is a federal program. It is no different from a state saying it would not help the federal government carry out an order to desegregate schools. States cannot interfere with or impede the achievement of a federal objective.”

Nonetheless, Lieu, a Georgetown University Law Center graduate, said he is undeterred. He noted the Fourth Amendment to the Constitution bars unreasonable searches and seizures and believes that if Congress doesn’t want to limit the NSA, California should.

“We are the ninth largest economy in the world,” Lieu said. “We have over 38 million residents and we are not going to stand idly by while Fourth Amendment rights are violated on a daily basis.”

Lieu introduced Senate Bill 828 with Republican Joel Anderson of El Cajon. If it passes and Gov. Jerry Brown signs it, the bill would prevent the state — or groups doing business on behalf of the state, such as contractors — from turning over data to the NSA without a warrant.

Eventually, Chemerinsky said, the federal government likely would take California to federal court.

“The reality is the federal government and federal law are supreme over state government,” he said.

But Lieu said passing the legislation is worth a shot.

“As of right now the president and Congress have not done anything to rein in the NSA,” he said. “I believe it’s time for states to speak up and assert their state’s rights.”