A Virginia judge in Warrenton ordered a temporary halt yesterday to pesticide spraying scheduled by state and federal officials to start early this morning in areas of Northern Virginia and West Virginia.

Circuit Court Judge Rayner Snead, acting on complaints that the pesticide, Dimilin W-25, may cause cancer, ordered the spraying operation postponed until a May 16 hearing on the case.

Virginia Agriculture Commissioner S. Mason Carbaugh immediately said the state will appeal the ruling. Federal officials later said they would await the outcome of the appeal.

Residents of Loudoun and Clarke counties were informed April 27 of plans to spray a 5,600-acre area to eradicate gypsy moth infestations along the Virginia-West Virginia border.

The moths eat the foliage of hardwood trees, according to state officials, and threaten lumber industries, nearby apple orchards and the "general esthetic effects" of the Blue Ridge Mountain area.

"We have to conduct the first spraying before (the May 16 hearing) or the chemical won't be effective," Carbaugh said in announcing the state's plan to appeal Snead's temporary restraining order.

Carbaugh said a possible compromise that would have limited the spraying area in Loudoun County was rejected by the state agriculture board shortly after it learned of the court order.

Lawyers for five Northern Virginia residents who sued the state to stop the spraying argued in part that tests of Dimilin's possible cancer-causing effects were inconclusive.

Although the pesticide has been approved by the Environmental Protection Agency for use in forested areas, and agency official said last week that there were "outstanding data gaps" in tests of the chemical on humans.