The Justice Department yesterday filed an unprecedented civil suit charging the city of Philadelphia, Mayor Frank Rizzo and 18 top city and police officials with condoning systematic police brutality.

Federal prosecutors have charged several Philadelphia police officers with criminal violations in alleged brutality cases, but this is the first time the government has alleged that an entire system violated the civil and constitutional rights of its citizens.

The suit charged that the city police department's practices of abuse were directed at all persons but were especially harmful to the rights of blacks and Hispanics.

The use of excessive force by Philadelphia police "shocks the conscience," the complaints said in asking for a court injunction to stop the alleged practices. The suit also asked that federal aid be cut off until reforms are made.

"Due to the systematic nature of the abuse, the conditions that create and reinforce it and the limitation on the effective employment of criminal prosecutions, that pattern or practice will not cease until those practices...are enjoined," the suit said.

The Philadelphia police force, the nation's fourth largest with more 8,000 officers, has a history of brutality allegations. The Justice complaint did not itemize instances of alleged brutality but said 75 persons are shot by police each year and civilian complaints number more than 1,100 annually.

Rizzo is named, the suit said, because as police commissioner from 1967 to 1971 he initiated many of the allegedly illegal policies. As mayor Rizzo "has acted to ensure the continuation of such policies," the complaint said.

Asked about the suit, Rizzo said the police department was innocent. "Police overreact sometimes, he said. "But so does a newspaper reporter, so does the president, so does the Justice Department.

"I hope we're not going the way of Iran - that policemen, just because they wear a blue uniform, are summarily rounded up and executed."

Rizzo called the suit "complete hogwash," and vowed to fight it.

"Nobody but nobody is going to take advantage of this great police department," he said.

He said that federal aid to the city amounts to about $4 million a year. Of the threatened cutoff, Rizzo said: "I'm ready to tell them they can stick it."

City Solicitor Sheldon Albert, who will defend the city in court, called the suit "purely political." He said the Carter administration was "pandering to the Hispanic and black communities because they perceive a hemorrhage of political support there."

He said the office of Peter Vaira, the U.S. attorney in Philadelphia, has sent him letters declining prosecution of accused Philadelphia police officers in 75 of 77 cases. The city also has won the vast majority of civil suits alleging brutality, Albert said.

"They don't have any evidence," he said. "They've reviewed every piece of paper in the department over the past 14 months and found nothing."

David W. Marston, who preceded Vaira as U.S. attorney and is running to succeed Rizzo in this fall's election, said yesterday he thought the suit was "the wrong action at the wrong time."

He said, "I took the lead in prosecuting police officers in brutality cases, but I was very careful to hit guilty officers, not malign the whole department like this suit does. It looks to me like the Justice Department is trying to give the impression of doing something. I left a lot of open files and there have been no federal prosecutions in the 18 months since I left the job."

Marston, a Republican, was fired by Attorney General Griffin B. Bell for insubordination early in 1978 amid reports that Marston's office was investigating Democratic members of Congress. Justice officials, who were delighted when Marston lost a primary race for governor last year, go out of their way to point out he's running for office again.

If Marston were to win the election for mayor, he would be substituted for Rizzo as defendant.

Drew S. Days III, head of the Justice Department's Civil Rights Division, denied the suit was politically motivated. He told reporters: "We conducted an investigation and found what we considered widespread abuses against the citizens. If that's political, so be it."

Days said the suit was aimed at top officials because "we're interested in making institutionalized changes."

The suit charges that the police department abused the rights of citizens by such tactics as accosting and beating them on the streets without cause, spying on critics and shooting suspects who weren't threats.

Philadelphia police leaders then covered up such violations, the suit said, by charging victims falsely with assaulting officers and by conducting internal investigations that intimidated witnesses and ignored evidence harmful to the police. Among the evidence ignored was a videotape of a beating of a handcuffed prisoner, according to the suit.

In some cases, officers whom superiors knew were guilty of abuses were promoted, the suit said.

Louis M. Thrasher, who headed the Justice Department investigation, said evidence to back up the generic charges will be introduced in court hearings. "The point of the complaint was not to say "here is a specific horrible," but to say "here is a system that is not designed to catch brutality and therefore encourage it.""

Many provable instances of brutality will be needed for the government to get past a precedent from a 1976 Supreme Court case that said there was insufficient proof of systematic brutality by the Philadelphia department.

The city also is expected to fight the case on the technical grounds that, under existing laws, the attorney general doesn't have authority to bring the civil suit.

The Justice Department has been investigating similar complaints of brutality in three other cities, Houston, Memphis and Mobile, Ala. CAPTION: Picture, At news conference announcing filing of civil suit against Philadelphia, its mayor and 18 other top city and police officials are, from left, Assistant U.S. Attorney John Penrose, Days, Vaira and Thrasher. AP