Congressman Ted Lieu of California has asked the FBI to drop its legal attack on Apple.

In a formal letter to FBI Director James Comey on Tuesday, the congressman said the FBI is trying to use federal courts to seek an authority it doesn't have: pressuring an American company to weaken the security of its technology.

"We should all take a deep breath and talk to each other, rather than use a lawsuit to circumvent the critical and necessary policy discussions," Lieu wrote.

Last week, prosecutors convinced a federal magistrate-judge to rule that Apple must help the FBI hack into the locked iPhone 5C of one of the San Bernardino shooters. Apple is fighting back. But if it loses, the government can legally force Apple to create a vulnerable version of its operating system.

To compel Apple (AAPL) to do this, the Department of Justice is relying on the All Writs Act, passed in 1789, which basically says that judges can tell all people to follow the law.

In a blog post on Sunday, the FBI director said this debate over privacy and safety "should not be resolved by corporations that sell stuff for a living."

In his letter, Lieu addressed both points.

"The profound issues at stake should not be decided, as you state, by either corporations or the FBI," he wrote. "Let Congress, stakeholders, and the American people debate and resolve these difficult issues, not unelected judges based on conflicting interpretations of a law passed 87 years before Alexander Graham Bell invented the telephone."

Congress is currently considering various proposals on secure technology that can't be hacked or spied on. Lieu's own bill, the Encrypt Act, would prevent the government from mandating weaker security. Meanwhile, U.S. Sen. Dianne Feinstein is working with Sen. Richard Burr on legislation that would require companies to work with law enforcement in all cases.

Lieu told CNNMoney that only Congress can decide whether Apple should have to build a backdoor for the iPhone.

"The FBI doesn't have the statutory authority to get that evidence," he said.

The FBI declined to comment on Lieu's letter.