WASHINGTON — The House on Tuesday strongly backed the right of reporters to protect the confidentiality of sources in most federal court cases, saying that right was crucial to a free and effective press. The White House, warning that the media shield bill would encourage leaks of classified information, threatened a veto.

Under legislation that passed 398-21, reporters could still be compelled to disclose information on sources if that information is needed to prevent acts of terrorism or harm to the national security.

That wasn't enough for the White House, which said the privileges given to reporters "could severely frustrate — and in some cases completely eviscerate — the ability to investigate acts of terrorism or threats to national security."

Advocates of press freedom have pushed the issue this year in the wake of several high-profile cases, including subpoenas for reporters to testify in a probe into the leak of a CIA operative's identity.

Supporters pointed to press reports on Abu Ghraib, clandestine CIA prisons and shoddy conditions at Walter Reed Army Medical Center as examples where source confidentiality was crucial.

"Freedom of the press is fundamental to our democracy and it is fundamental to our security," House Speaker Nancy Pelosi said.

More than 50 news outlets, including The Associated Press, support the bill, which faces an uncertain future in the Senate.

In other action:

• The Senate, shrugging off a veto threat by President Bush, passed a $57 billion bill Tuesday that restores major cuts to an anti-crime program that Bush has sought to virtually eliminate.

The Community Oriented Policing Services — or COPS — program was established under the Clinton administration and is a favorite of lawmakers, especially Democrats, for the grants it doles out to local police departments for hiring grants and new equipment.

The COPS program would receive $660 million under the underlying appropriations bill, which passed by a 75-19 vote and funds the Justice Department budget and various Commerce Department and science programs, including NASA and the decennial census.

• The House passed a resolution on Tuesday condemning the State Department for its refusal to divulge public details on Iraqi corruption in a new showdown with the Bush administration over the war and its classification policies.

"The Bush administration is hiding the truth while seeking hundreds of billions of dollars and placing our troops in danger. And we cannot allow this to happen," said Rep. Henry Waxman, chairman of the House Oversight and Government Reform Committee.

Waxman sponsored the nonbinding resolution, which states that the administration abused its power by classifying U.S. assessments on corruption inside Prime Minister Nouri al-Maliki's government. The House agreed to the measure, 395-21.