The FBI is investigating a complaint that the civil rights of Terrence Johnson may have been violated at the Maryland prison where he is serving a 25-year sentence in the fatal shooting of two Prince George's County policemen.

Allen Lenchek, a lawyer for the 16-year-old Bladensburg youth, said Johnson complained three weeks ago to the Justice Department of nine incidents in which he was allegedly assaulted, beaten or otherwise mistreated at the Maryland Correctional Institution at Hagerstown.

Johnson has been at Hagerstown since shortly after his May 4 sentencing on one count of manslaughter and a weapons offense.

Justice Department spokesman said the department's civil rights division "received a complaint regarding Johnson and has asked the FBI to look into it."

The spokesman said federal law makes it a misdemeanor for a prison guard or other law enforcement officer to use excessive force against a prisoner.

Edwin R. Goodlander, the head of Maryland's prison system, pledged cooperation last night with any investigation the FBI might make. "We would not wish to impede any investigation by further comment at this time," Goodlander said.

An FBI spokesman said only that an investigation is under way into an allegation of a possible civil rights violation at Hagerstown. He said an investigation of charges that right of an inmate at a state prison have been violated is "not unusual."

The spokesman said that in such cases the FBI conducts a "preliminary type" investigation, the results of which are turned over to the Justice Department for determination of whether a violation occurred.

Johnson, who is black, shot and killed two white Prince George's police officers in 1978 in an incident that appeared to divide the county along racial lines.

He was acquitted March 31 of murder charges and convicted of manslaughter in the death of one officer.