In a federal courtroom packed with firefighters, lawyers for the District yesterday defended the D.C. Fire Department's new affirmative action plan against attacks by the U.S. Justice Department and the firefighters' union, after both argued that the plan illegally discriminates against white members of the force.

The battle played out yesterday before U.S. District Judge Charles R. Richey is one of many similar clashes going on around the nation, in which Justice's Civil Rights Division -- in a reversal of roles -- is seeking to overturn or amend state and local affirmative action plans.

Justice has challenged the D.C. plan -- with its strict numerical goals to increase minority representation in the department -- as one that is "discriminatory because it grants preferences for hiring and promotion based on race and sex."

"This case is of great national importance and will be looked on throughout the country," Richey told spectators and the 17 lawyers assembled for the unusual Saturday hearing, which he set to speed conclusion of the case. Hiring and promotions in the department, which has 114 vacancies and has paid $2.1 million in overtime in the past six months, have been frozen because of the controversy.

As the arguments concluded, Richey urged the lawyers to negotiate while awaiting his written opinion. "Let's all of us do our best not to let time pass . . . because it is an unmistakable fact," he said, that minorities have been hired and promoted in "disproportionate numbers."

D.C. Corporation Counsel Inez Smith Reid yesterday argued that the plan is a reasonable and constitutional remedy to the "grossly disproportionate hiring" of minorities during the past 25 years.

The plan, put into effect in January but now suspended by the judge, sets a long-range goal of hiring women and minorities in proportions equal to their representation in the D.C. work force. Currently, blacks account for about 64 percent of the D.C. population and make up about 38 percent of the department's uniformed work force.

The plan sets an immediate goal of hiring women and minorities in proportions equal to their representation in the applicant pool and promoting a strict number of minorities to sergeant, lieutenant and captain in the next 18 months.

It is those short-term numerical goals that are under attack by Justice and Local 36 of the International Association of Fire Fighters.

Yesterday, Justice attorney Richard Ugelow argued that the plan "denies white persons protections solely because of their race." It uses "rigid racial quotas" to overcome the city's "failure to provide" valid selection procedures for new hires, he said. Justice is seeking to overturn the hiring and promotion aspects of the plan.

Local 36 has attacked only the plan's promotion aspects, which resulted March 8 in the promotion of five black firefighters over a number of white firefighters who ranked above them on a promotion list for sergeants. The list was based primarily on scores on a 1982 exam.

Yesterday George H. Cohen, representing the union, charged that the plan was designed to "mandate racial balance" in D.C. government offices rather than remedy past discrimination. That, he argued, "is constitutionally impermissible."

Lawyers representing black firefighters, who launched the battle in 1980, argued yesterday that the department has a long, well-documented history of racial discrimination. The black firefighters have put forth their own plan and have asked the judge to modify the D.C. plan to incorporate their suggestions.