A House-Senate conference committee approved landmark balanced-budget legislation last night, and President Reagan quickly said he would sign it if Congress approves the bill, as expected today.

"I strongly endorse this measure," Reagan said, "and urge the Congress to act quickly and make this the law of the land." The president added that he would continue to fight for his military buildup.

White House officials said the president approved of the compromise version of the measure despite provisions that they calculate could lead to cuts in defense budget authority of more than $10 billion this year alone. Pentagon officials estimated that the figure could go as high as $18 billion. Budget authority reflects policy commitments to spending in later years.

Reagan endorsed the compromise, often referred to as Gramm-Rudman-Hollings, after a heated internal discussion at the White House. Incoming national security adviser John M. Poindexter urged the president not to accept the compromise because of its impact on defense, according to White House officials. But chief of staff Donald T. Regan backed the compromise, and Reagan sided with him, officials said.

The president's decision to endorse the conference committee bill appears to end the months-long dispute among senior officials over whether Reagan should sign the bill. The president had backed an earlier version, but Defense Secretary Caspar W. Weinberger had continued to express strong opposition with support from Secretary of State George P. Shultz.

Regan argued repeatedly that without balanced-budget legislation, the defense budget would be vulnerable to even deeper cuts because Congress would be inclined to protect domestic programs.

On Capitol Hill, the conference committee cleared the bill by voice vote and with little debate, abruptly climaxing weeks of protracted negotiations over the details of the far-reaching and complex legislation.

As approved by the conference committee, the bill would establish mandatory, declining targets for the federal budget deficit over the next five years and require a balanced budget for the fiscal year that begins Oct. 1, 1990. If necessary, automatic cuts in most government programs would be imposed to meet the deficit targets.

The bill's impact would be immediate, requiring up to $11.7 billion in spending cuts in the current budget by March 1. In the next budget that Reagan will submit to Congress early next year, the deficit target would be $144 billion, or about $56 billion less than the estimated $200 billion deficit in the current fiscal year.

Among those likely to be the first to feel the effects of the legislation are civilian federal government and military retirees.

In anticipation of the first $11.7 billion budget cut on March 1, the bill calls for cost-of-living adjustments in their pensions to be deferred beginning Jan. 1.

The final agreement that paved the way for the committee's approval of the bill was reached at 1 a.m. yesterday by weary negotiators from among Senate Republican and House Democratic members of the conference.

The last-minute issues that temporarily stalled the bill centered on Reagan's insistence that he be given additional flexibility in imposing mandatory defense cuts that would be triggered by the legislation. In the bill's final version, the president was granted authority to exempt from mandatory cuts those budget categories that set the size and pay of the uniformed military services. If he did this, however, deeper cuts in other portions of the defense budget would be required.

House Majority Whip Thomas S. Foley (D-Wash.), one of the negotiators who hammered out the final version, said the White House had sought "complete, across-the-board flexibilty" in the defense budget for the entire five-year life of the legislation. Instead, Reagan was granted only limited flexibility, and only for this year.

The expected defense cut for the current fiscal year, 1986, would be $5.8 billion. But actual defense spending is spread out in installments over several years. Thus, for every dollar in spending that must be reduced this year, the Pentagon must cut between $2 and $4 of budget authority, which are the policy commitments Congress has made. White House officials said last night that Reagan had been told the 1986 cut in budget authority would be more than twice the $5.8 billion amount. But Pentagon officials estimated it could be triple that amount.

In a statement last night, Reagan said the bill "in the extreme . . . could have adverse effects" on defense.

"We have no higher priority than maintaining a strong national defense. To that end, I am committed to and will propose budgets that meet this requirement. I look forward to working with Congress to implement our previous agreements on defense spending levels," Reagan said.

The conference committee bill calls for automatic, across-the-board cuts to be imposed in most government programs if Congress fails to meet the deficit target for that year. Social Security and a number of antipoverty programs, as well as interest payments on the national debt, would be exempt from these cuts, while Medicare and other health programs would be subject to only limited cuts. All other federal programs would be subject to automatic cuts, with half the savings to come from defense spending and half from domestic expenditures.

The balanced-budget measure is an amendment to legislation that would raise the national debt ceiling to more than $2 trillion. The deadline for its enactment is midnight today, when a temporary debt-ceiling extension passed by Congress last month expires. Failure to lift the debt-ceiling could lead to an unprecedented government default by the end of the week as the government, stripped of its authority to borrow, could not meet its obligations.

The conference committee spent little time debating the measure before approving it.

The only objection voiced in the committee came from Sen. William V. Roth (R-Del.), who charged that the final version of the measure "puts us firmly on the path of a series of major tax increases over the next five years" to meet the deficit targets.

But Sen. Phil Gramm (R-Tex.), a sponsor of the measure along with Sens. Warren B. Rudman (R-N.H.) and Ernest F. Hollings (D-S.C.), said tax increases were not inevitable under the legislation. "I didn't come here to raise taxes," said Gramm.

Last night, Reagan warned again that he would resist tax increases.

Shortly after the conference committee acted, the Senate, also by voice vote, passed a $498 billion omnibus spending measure that is needed to fund government agencies for which Congress has not passed regular appropriations bills. The so-called continuing resolution, which must be enacted by midnight Thursday when current stopgap spending authority expires, now goes to a conference committee to reconcile differences with a House-passed version. Reagan has threatened to veto either version.