ROCKLAND, Maine — A judge has sided with Knox County’s sheriff in a lengthy legal battle between her and the county administration over who has the authority to conduct internal investigations and personnel decisions.

The ruling extends beyond Knox County, according to attorney Jonathan Berry who represented Sheriff Donna Dennison and the Maine Sheriffs Association which joined the lawsuit filed in January 2009.

“It’s a good day for Maine sheriffs,” Berry said.

Justice Jeffrey Hjelm ruled March 2 that the sheriff retains responsibility for administering and directing investigations and personnel practices and decisions within her department.

“Provisions of the Knox County Charter that purport to authorize the County Commissioners and the county administrator to intervene in such administration and direction are void and unenforceable,” Justice Hjelm ruled.

Sheriff Donna Dennison said she took no pleasure in having to take the county to court but there was an important principle involved in the case.

“I’m glad it’s over,” Dennison said.

Berry said this issue has been building throughout Maine over the past 20-30 years.

In Knox County, the issue came to a head during labor negotiations between the county and sheriff’s department employees in terms of who has authority over employees. The disagreement over control of personnel matters continued into 2009 when the sheriff appointed Tim Carroll as patrol administrator after County Administrator Andrew Hart had rejected her request to promote him to that post.

The sheriff maintained during meetings with county officials that it was her responsibility to act on such matters.

Berry said that the state law is clear that the county commissioners have the authority to set the budgets for the sheriff’s department and the sheriff must operate within those parameters.

Penobscot County Sheriff Glenn Ross, who is president of the Maine Sheriffs Association, said the association felt it was important to intervene in this case because sheriffs derive their authority from both the state constitution and state law.

Sheriffs are elected by the people and if their authority is eroded by county commissioners or a county manager, the sheriffs’ roles could be reduced improperly to that of a department head, Ross said. Ross said he had not had problems in his county and that he works well with Penobscot commissioners and each side knows the boundaries of their authority.

The Knox County Charter was approved by Knox County voters in November 2004. The charter gives the county administrator the authority over personnel matters in all departments.

The sheriff and the sheriffs association, however, argued that state law supersedes that provision of the county charter.

“The sheriff shall act as the chief law enforcement officer and is responsible for administering and directing the sheriff’s department as authorized by the county budget,” Justice Hjelm ruled, citing Title 30A, section 401 in state law that establishes the relevant limitations on the commissioners’ power to intervene in the operations of the sheriff’s department.

Knox County Administrator Hart referred questions on the ruling to the county’s attorney John Wall of Portland. Wall said Friday that he expected to meet with commissioners next week to discuss the court decision.

Knox County Commission Chairman Roger Moody said he has not read the decision but that commissioners would likely discuss the matter in a closed-door session next week with its attorney. He said it was too early to know whether the county would appeal the decision.