Part of a tangled, sometimes bitter legal dispute between County Executive Wayne K. Curry and the county sheriff's department over who should pay for courtroom security at the Prince George's County District Court has been resolved, the county attorney said yesterday.

At a hearing yesterday before Charles County Circuit Judge Steven G. Chappelle, County Attorney Sean Wallace disclosed that the county and sheriff's department have hammered out an agreement over funding and staffing for the sheriff's department for the current fiscal year.

Chappelle is presiding over a lawsuit to determine who should pay for security at the Upper Marlboro court and how much money the sheriff's department should get from the county.

Wallace told the judge that his office had reached the agreement with Stan Brown, a private lawyer retained by the sheriff's department.

But the agreement and the fact that the sheriff's department had hired another attorney came as a surprise to Associate Attorney General Larry Fletcher Hill, who has been representing the sheriff's department, the state and the District Court.

Fletcher Hill immediately asked for a continuance in the hearing, which Chappelle reset for Sept. 29.

"We have to sort out the representation issues and find out what the agreement is," Fletcher Hill said in an interview.

In court, Wallace reminded Chappelle that during a meeting in the judge's chamber, Chappelle himself had raised the issue of the propriety of Fletcher Hill representing different parties to the same lawsuit.

Wallace said he could not disclose the terms of the agreement with the sheriff's office because some details hadn't been nailed down.

"I think we're both satisfied with the agreement," Curry said late yesterday. "The major issue of what the state owes us for the years it didn't pay and for future allocations from the state remains to be decided by the court."

The county's funding of the sheriff's office is one of the issues to be determined by the complex lawsuit, which started out as several lawsuits before they were consolidated.

Former sheriff James V. Aluisi (D) filed a lawsuit against the county, alleging that Curry had slashed the sheriff's department budget too far.

Curry then countersued Aluisi, alleging waste and mismanagement and asking the courts to put the sheriff's office under the control of a receiver. The county also sued the State of Maryland, arguing that many of the courthouse security duties Aluisi said he was unable to provide should be funded by the state.

Outside of court, Wallace noted that Sheriff Alonzo D. Black (D), who was elected last year, was never a party to the lawsuit brought by Aluisi.

"The bottom line is that the county and sheriff have settled whatever differences they had over this issue," Wallace said.

If the agreement between the county and the sheriff's office is finalized, the issue of how much the state should pay the county for providing security would remain an issue in the lawsuit, which Chappelle would decide.

In the past 25 years, the county has spent more than $50 million providing security for District Court, a state-funded court, Wallace said.

The cost of providing District Court security during this fiscal year will be about $1.8 million, he said.

The sheriff's department provides security in Circuit Court, which is also in the Upper Marlboro courthouse, at county expense.

In June, the state Court of Appeals, in a unanimous decision, ruled that the state government, not Prince George's County, must pay for security at Prince George's County District Court.