Gov. Harry R. Hughes and the General Assembly leadership today resolved a sharp philosophical dispute over the best way to provide relief for Maryland taxpayers by working out a compromise that includes most of what both sides wanted.

The agreement came five days after legislative leaders threatened to "send a message to the governor," as one put it, by rejecting his measures and approving their own, which they claimed offered more "visible" tax relief for their suburban, middle-class constituents.

Hughes, faced with his major confrontation with the legislature, responded that he was "always willing to look at compromise," and immediately set up a series of meetings with House and Senate leaders that resulted in the agreement announced today.

"This is as close as we can come to a consensus," said Hughes. "It meets my thoughts, my desires, and also the goals of the legislature."

The basic elements of the compromise are these:

Hughes agreed to support the elimination of the sales tax on utility bills, as the legislature wanted, rather than simply cut the tax in half, from 5 percent to 2.5 percent, as the adminstration originally proposed.

The legislative leaders, in return, said they would support Hughes' plan to increase the standard deduction on the state income tax from the current 10 percent to 13 percent of an individual's taxable income.

Hughes originally sought to establish at 15 percent the maximum standard deduction for those who do not itemize their state income tax returns.

Many legislators rebelled at this plan, arguing that such a substantial increase in the standard deduction would be of little benefit to a majority of their homeowner constituents, who usually itemize their tax returns.

The compromise increase to 13 percent, Hughes said, would satisfy his goal to target as much of the tax relief as possible to lower income people, particularly when coupled with a measure to extend tax relief to elderly and disabled renters. Legislative leaders agreed to support the renters' relief plan as another facet of the compromise.

Hughes announced the compromise this afternoon at a press conference with House Speaker Benjamin L. Cardin and Senate President James Clark Jr., both of whom expressed satisfaction with the agreement and said the entire tax package now would receive swift legislative approval.

"It is good solution to a difficult situation," said Clark. "I think we used our money for tax relief wisely and well."

Cardin, the acknowledged tax expert in the legislature, called the compromise "an excellent one," and complimented Hughes for his willingness to negotiate. "The accessibility of the governor on this issue has been extraordinary." he said.

Hughes said the compromise "balances out" so there is little or no change in the amount of money-about$110 million-returned as tax relief from the $296 million surplus accumulated this year.

In addition to this direct tax relief, the state is returning about $90 million to the local governments through various aid formulas and about $18 million to state business through the elimination of the machinery tax.

In his last supplement to the state's $4.8 billion 1980 budget, Hughes made several of the local aid formulas contingent on the legislature cutting in half, rather than eliminating, a utility tax. This contingency was dropped as part of today's compromise.