SACRAMENTO, Calif.—Legislation that takes exception to a federal anti-terrorism law produced an unusual alliance Tuesday between one of the Legislature's most liberal lawmakers and one of its most conservative members.

Sen. Mark Leno, D-San Francisco, said his carrying of a bill by Republican Assemblyman Tim Donnelly illustrates bipartisan agreement that the federal government is going too far and trampling on civil liberties.

AB351 by Donnelly, who is from the San Bernardino Mountains community of Twin Peaks of Southern California, would prohibit state agencies, employees and the California National Guard from enforcing a federal law allowing for indefinite detainment. Federal agencies could enforce U.S. law but would do so without the state's assistance, under the bill that now goes to Gov. Jerry Brown.

"Indefinite detention, by its very definition, means that we are abrogating, suspending, just throwing away the basic foundations of our Constitution and of our nation," Leno said.

The concepts that suspects are innocent until proven guilty, have a right to a speedy trial by an impartial jury, a right to due process and a right to be informed of pending charges are at risk under the provisions of the National Defense Authorization Act, he said.

He said Michigan and Virginia have passed similar laws. The California communities of Berkeley, Fairfax, Santa Cruz and San Francisco have all passed resolutions opposing the federal law.

The measure passed the Senate, 37-0, after Leno took some ribbing from fellow lawmakers for carrying the bill. Donnelly is a conservative who once headed the Minuteman Civil Defense Corps of California, a vigilante group that patrolled the U.S.-Mexico border in search of people attempting to enter the U.S. illegally.

"Wait, let's get a picture," called out Sen. Fran Pavley, D-Agoura Hills.

"You'll never get elected in San Francisco again," added Sen. Mark DeSaulnier, D-Concord.

Leno said it is the first time he has allied with Donnelly.

"It doesn't matter where one finds oneself on the political spectrum," he said. "These two sections of this national defense act are wrong, unconstitutional and never should have been included."