Mayor Marion Barry yesterday fired Anita B. Shelton, the director of the D.C. Office of Human Rights since 1979, and nominated as her replacement Maudine R. Cooper, an official in the Washington office of the National Urban League.

The surprise move was announced by Barry's press office late in the day, with virtually no explanation for why Shelton had been removed. "The mayor wasn't satisfied with her performance--and that's it," said Annette Samuels, the mayor's press secretary.

Shelton, a veteran civil rights activist who previously worked for the National Council of Negro Women and the Urban League, has been at odds with members of the D.C. Human Rights Commission and other city officials over the way she administered her office and handled discrimination cases.

Critics claimed that Shelton failed to run the office efficiently, resulting in a mounting backlog of cases. "The main problem was that she had no commitment to clean up the act" of the office, said Lee Perkins, a member of the human rights commission from 1977 to 1982.

Shelton could not be reached for comment late yesterday, despite repeated attempts.

The appointment of Cooper to replace Shelton must be confirmed by the D.C. City Council, which is not scheduled to resume work until after the Labor Day weekend. Tina Smith, the mayor's director of special services, will serve as acting director of the human rights office until Sept. 19, when Cooper is expected to come aboard.

Cooper has been with the Urban League since 1973 and currently serves as vice president for the league's Washington operations--the first woman to hold that post. She also has been an instructor at Bowie State College in Maryland and a trial lawyer for the Internal Revenue Service.

Recently, she was honored by the National Association of Black Women Attorneys and the National Bar Association.

"She's a nice, easygoing person--very active, very involved in a lot of human rights and civil rights activities over a number of years," said Pauline Schneider, the mayor's director of intergovernmental relations and one of Cooper's close friends.

The human rights office is charged with hearing and resolving complaints on discrimination in employment, housing, public accommodations and education for 15 protected categories of D.C. citizens, such as blacks, women, Hispanics and handicapped persons.

It also has a mandate to correct discriminatory practices in D.C. government hiring and promotions and must approve the affirmative action plans of D.C. agencies and contractors.

Shelton, 48, was appointed by Barry in April 1979 as his first director of the human rights office.

She took over an office that was frequently criticized for a large backlog of unprocessed cases and administrative problems. Shelton promised a systematic review of the affirmative action records of all D.C. employers.

But over the past 4 1/2 years the office has continued to have administrative problems and a large backlog of cases for which it is still strongly criticized.

Budget and staffing at the office may be part of the problem. When Shelton took over, there was a staff of 50 and a budget of $1.2 million. The budget for fiscal 1984 is about the same now as in 1979, but the number of staff has declined to 33, Shelton said earlier this year.

At the same time, the number of complaints coming into the office "is increasing tremendously," Shelton told a congressional subcommittee earlier this year, with a 30 percent increase in the number of employment complaints.

She said the office had investigated and adjudicated 1,000 discrimination cases last fiscal year and awarded more than a half million dollars in damages to about 134 complainants.

One of Shelton's more controversial decisions was to order the city in 1981 to fill 60 of 70 available firefighting jobs with members of minority groups and to give minorities preference in all new hiring.

The office itself was charged with discrimination in 1980 by the federal Merit Systems Protection Board after Shelton fired three high ranking employes and demoted three others out of what the board called personal animosity.