The union that represents District of Columbia police officers yesterday endorsed for mayor Marion Barry, a man who for more than a decade had needled, angered and characterized the city's 4,200-man police force as an alien "army of occupation."

But the mutual mistrust that once separated Barry and the policemen has at last been bridged between the candidate and Larry L. Simons, president of Local 442, the International Brotherhood of Police Officers, the collective bargaining agent for city police officers. Simons said the 15-member executive board of the union's local voted unanimously to endorse Barry. They intend to contribute money directly to his campaign and hold fund-raisers for him, Simons said.

Yesterday Barry stood to the left of Simons before the gray-stone entrance of the city's police headquarters at 300 Indiana Ave. NW, and said their endorsement "represents a fantastic achievement for both of us."

"As you know, during the late '60s there were a lot of differences between the community and the police department, and I was at the forefront of the effort to have the department become more sensitive and responsive to the needs of the community," Barry said.

"We're not going to hold Barry's past against him," Simons responded to a question before the press conference began. "Because he got locked up before because of a cause he believed in has nothing to do with what we think of him today."

Beside contributions and fund-raisers, it was unclear how the policemen could help Barry's candidacy since they are prohibited from engaging in overt political activity by the Hatch Act. The Washington Teachers Union, which endorsed Barry last week, is not covered by the act but the city's firemen, whose Fire Fighters Association is also expected to endorse Barry are.

While Barry now has the endorsement of two unions and the expected endorsement of a third, Mayor Walter E. Washington still has the overwhelming major share of union support in the city. The other major mayoral candidate, City Council Chairman Sterling Tucker, is not expected to get any union endorsements.

From his beginnings in 1965 as an organizer for the local chapter of the Student Nonviolent Coordinating Committee to his days as the cordirector of Pride Inc., Barry periodically gave loud vocal vent to his disdain for police in general and Washington's blue-shirted department in particular.

As recently as two years ago - several months before running for reelection to the City Council - Barry talked openly about his resentment, mistrust and hostility toward policemen. These feelings, he said, grew out of early childhood experiences in Memphis. In his early youth in the Deep South, Barry said he was arrested at least 20 times, beaten twice, called "nigger" and "boy" countless times.

Barry brought those attitudes toward policemen with him to Washington and was involved in several minor scrapes with them. Since serving in an at-large seat on the council, Barry has pushed for a residency requirement for newly hired policemen and called the city's police force "an army of occupation" because most live in the suburbs.

But Barry's image, at least with police union officials, began to rise last year when he pushed through the City Council legislation that provided the policemen with pay raises at the beginning of the city's fiscal year. "It was the first time in memory," Simons said, that policemen received their raises when they were supposed to.

Before Barry introduced his bill, Simons said, the police union negotiations were hopelessly deadlocked with Mayor Washington's representatives "because the mayor refused to negotiment, Simons said "we now know that police officers would have received no pay raise whatever without the Barry bill."

Simons said the policemen's union was not supporting either Washington or Tucker because both were inaccessible to union officials when their help was needed. They mayor was not available for comment but Tucker said through a spokesman that he has always been available to help the police union officials. "I will receive the votes of those D.C. officers who live in the District," Tucker said.

Several policemen, including two from the rival D.C. Policemen's Association, said yesterday that a significant number of policemen who are members of Simons union were surprised and angered by their union's endorsement of Barry. Simons local 442 and the smaller D.C. Policemen's Association are engaged a dispute will be heard by the D.C. Labor Relations Board June 15.

Besides Barry, Tucker and Mayor Washington, the other Democratic mayoral candidates include John L. Ray, Dorothy Maultsby, Richard A. Jackson, Chalres S. (Trummie) Cain and James Clark.