The powerful Virginia highway department agreed yesterday to pay $1 million and set specific hiring goals for blacks and women in each of its nine districts to settle a Justice Department job discrimination lawsuit.

Justice, which filed both the suit and the consent decree in the U.S. District Court in Richmond, alleged that Virginia's largest government agency had discriminated against blacks and women in hiring and promotion. After a long investigation, Justice said it found the practices of the Virginia Department of Highways and Transportation amounted to "a pattern or practice of resistance" to the Civil Rights Act of 1964.

The consent decree, which would place the highway department under continuing federal review, still must be approved by a federal judge. State Highway Commissioner Harold C. King could not be reached for comment last night, but in agreeing to settle the case without a trial his agency denied any acts of discrimination.

David Hathcock, a spokesman for Virginia Attorney General Gerald L. Baliles said the complaint is "the official mechanism to end a review that started in 1977." He stressed that the agreement still has to be approved by a federal judge, but said no problems are anticipated in getting that approval.

"We think the agreement shows that the Justice Department takes cognizance of the present effort by the Department of Highways and Transportation to recruit a work force that is representative of the population as a whole," Hathcock said.

He said the maximum amount that will be paid to an individual under the agreement will be $4,500.

The department, unlike most state road agencies, builds and maintains almost every road in the state and its counties, from one-lane dirt trails to the eight-lane Capital Beltway. As a result, the department has long been one of the state's major employers, acting as the job bank of last resort during and after the Depression and providing political patronage for the once-powerful Byrd organization.

In recent years, the department has been hit by declining funds and has had to reduce its work force. It still employed more than 10,000 people as of July 31, according to the Justice Department complaint.

Of those employes, 10.3 percent are black and 11.5 percent are women. While a little more than a quarter of the white employes work in service and maintenance jobs, Justice said more than half of the black workers are assigned to those categories.

In agreeing to settle the lawsuit, Virginia agreed to pay as much as $1 million in back pay to black and women workers who are found to have been unfairly denied promotions any time since 1975. Justice spokesmen said they did not know how many workers might be eligible.

The highway department also promised to create training programs to help blacks and women advance and to establish new criteria for hiring and promotion to replace what Justice called the "subjective and discretionary employment standards" Virginia has used.

In addition, state officials accepted district-by-district recruitment goals for blacks and women, although the consent decree stresses the goals "are not and will not be treated as quotas." The state must take affirmative action to recruit blacks and women, but Justice promised not to consider any failure to meet the goals as evidence in itself of bad faith.

In Northern Virginia, for example, the department promised to try to hire blacks for at least 15 percent of technical jobs and 10 percent of clerical, skilled craft and professional positions. The department also agreed to try to hire women for 25 percent of professional positions, and 15 percent of technical jobs.

Officials said they did not know how many new positions will be open in a department that has laid off more than it has hired recently. Gov. Charles S. Robb imposed a hiring freeze for all state agencies when he took office last year and recently said the state is facing a $305 million deficit in the current biennium.