A federal judge scathingly criticized the state attorney general's office today as he dismissed Virginia's attempt to draw New York City into a waste haulers' lawsuit that seeks to overturn state restrictions on imported trash.

U.S. District Judge James R. Spencer, who in a previous court session said that Virginia's attempt to prohibit New York City garbage from being barged to the state was a "crystal clear" violation of the U.S. Constitution, added today that he found "no basis in law" for the state's request to make New York City an involuntary plaintiff in the trash haulers case.

"In the back of my mind," Spencer said, "there's an echo saying, 'Are there still some lawyers present over in the attorney general's office?' " The notion that New York should be included in the case "borders on the frivolous," the judge said.

"If you want to have a mud-slinging contest with New York City, that's your business," Spencer told the state's lawyer, "but it won't happen here."

Today's hearing was one of several preliminary moves that eventually will lead to a trial on whether Virginia had the authority under the Constitution to ban the transportation of garbage on its rivers and to limit daily dumping at landfills.

On June 29, Spencer temporarily blocked enforcement of the new laws, citing strong doubts about their constitutionality. After that ruling, Virginia asked the judge to make New York City a part of the lawsuit, filed by Waste Management Inc., the nation's biggest garbage hauler, and others seeking to overturn the Virginia laws.

After Spencer's comment today regarding the state's legal work, Attorney General Mark L. Earley said in a statement that, "I am disappointed a judge would make such an unfortunate remark from the bench. The lawyers in our office work hard to uphold the laws passed by the General Assembly and to provide Virginians the best legal representation possible. That is their job, and they will continue to do it."

William H. Hurd, senior counsel to Earley, who argued for the state, was undeterred by the judge's ruling and comments.

"Federal judges get to say things like that, and there's nothing attorneys can do about that," Hurd said after the hearing.

Hurd said he may try to subpoena New York City Mayor Rudolph W. Guiliani at a future hearing.

New York was not represented at today's hearing, but its corporation counsel, Michael D. Hess, said, "We are gratified that the judge saw through this blatantly improper attempt to drag New York City into a politically motivated litigation."

D. Alan Rudlin, a lawyer who represented the waste industry in court today, told Spencer that the sole question before him was, "does the Virginia law violate the U.S. Constitution." Rudlin said afterward that he was pleased that the judge was "getting to the heart of the matter, and that doesn't require New York City to get there."

The restrictive statutes were enacted by the Virginia General Assembly this spring to reduce the flow of out-of-state trash to landfills in the state. Virginia took in 4.6 millions tons of garbage from other states last year and ranks second only to Pennsylvania among the nation's garbage importers.

But the U.S. Supreme Court has ruled that garbage shipments constitute interstate commerce and thus deserve protection under the commerce clause of the federal Constitution, which gives Congress the power to regulate such trade.