President Carter announced last night that the coal industry and United Mine Workers have reached a tentative settlement that could end the nation's longest coal strike within 10 days.

Under extraordinary White House pressure, the two sides reached agreement with little more than two hours to spare before Carter was scheduled to go on nationwide television and announce that he was taking action to force the 160,000 strikers back to work.

Instead he preempted the evening news with a dramatic announcement of the settlement and a strong, personal appeal to the coal miners to ratify the contract in a secret-ballot referendum that could occur in a week to 10 days.

Praising the miners for patriotism and dedication to their work, Carter said, "I hope you will follow the lead of your bargaining council and ratify the settlement. It serves the national interest as well as your interests and those of your families. If it is not approved, I will have to take the drastic actions I was prepared to take tonight."

That action reportedly included asking the federal courts to order the miners back to work for 80 days under a Taft-Hartley Act injunction and seeking congressional approval for government seizure and operation of the mines.

If the tentative settlement is approved - and there are no guarantees that the often rebellious miners will do so - it will spare vast sections of the nation's industrial heartland from severe electric power cutbacks and massive job layoffs.

It will also free Carter from a risky showdown over his leadership abilities and spare Congress a potentially bitter fight over nationalization of a major industry just as deliberations over the Panama Canal treaties and energy legislation are coming to a climax.

Sources indicated that the Bituminous Coal Operators Association, which represents 130 companies accounting for one-half the nation's coal production, made major concessions to meet the UMW's supposed "bottom-line" demand - an agreement worked out earlier with an independent coal company.

Dropped were demands for strong disciplinary action against miners who honor wildcat picket lines, production incentives and other measures to enforce labor stability and increase miners' wages and benefits by about 37 percent, including boosting hourly wages from $7.80 to $10.20, a slight increase over an earlier tentative UMW-BCOA agreement that was rejected earlier in the month by the union's bargaining council.

Because the labor stability issue remains largely unresolved and is bound to remain a problem in the strike-prone coalfields, Carter siad he is appointing a commission to look into "basic questions of health, safety and stable productivity" in coal production, which is the centerpiece of his energy program.

"This is the outcome toward which all of us have been working so hard," said Carter. "It was because we believe in the free process of collective bargaining that I have been so determined to give that process every chance to work. It has worked, and the settlement it has produced is better for everyone involved."

UMW President Arnold Miller termed the agreement a "good contract" and said it includes all the health and pension benefit guarantees that the union sougt.

There was no immediate comment from the beleagured coal industry, which had been subjected to intense administration pressure over the last few days to bow to the union's final demand.

It was understood that top industry officials contacted the union privately late Thursday and went into intensely secret negotiations yesterday, culminating in final industry acceptance of the settlement only shortly before Carter went on television to announce it.

However, there was one historical caveat to Carter's prime-time performance. Former President Johnson did the same thing in a major strike in 1960s. only to have the rank-and-file workers embarrass him with a contract rejection.

The tentative agreement reportedly differs little from the general outlines of the recently expired contract in terms of strike controls, except that it would permit companies to fire or suspend wildcat strike instigators and pickets. Fines for participating in unauthorized walkouts were dropped earlier by BCOA, but the association had been holding out against guaranteeing benefits and dropping several labor-stabilizing proposals.

Carter's request for television time - the final turn of the screw in the adminstration's high-stakes pressure campaign to end the increasingly disruptive strike - came only hours after he met with top coal executives and issued a personal appeal for them to agree to the UMW's "bottom-line" demand.

The irreducible minimum for the nion was a tentative settlement it reached last weekend with the Pittsburg and Midway Coal Mining Co. a small independent that is not a member of the 130-member BCOA, the major industry bargaining group.

Although it had agreed earlier to a 37 percent wage-and-benefits increase over three years, the BCOA balked earlier this week at the P7/8M pact as a model for an industrywide settlement, saying it did too little to curb wildcat strikes, enforce labor stability or speed up production.

The executives, who included top officers of big mine-owning steel and oil companies had not responded as of mid-afternoon when the White House rattled its last saber and confirmed that it had called the television networks.

"There is no settlement at this point, and the president intends to act," said White House spokesman Jody Powell. "Nothing has happened to cause the president to feet there is no reason to act."

At about the same time, another source said there appeared to be "about a 15 percent chance" that the move might prompt a favorable - if decidely grudging - response from the industry chiefs.

The coal strike, one of the most intractable major-league labor disputes in the quarter-century since World War 11 is perhaps the biggest test thus far of Carter under fire - with enormous potential consequences for his reputation as a leader and for important administration initiatives on Capital Hill, including the beleaguered energy package.

"If he wins, he wins big." said one administration official, "and if he loses, I don't want to think about the consequences."

When the strike started Dec. 6 after two months of intermittent negotiations collapsed, the administration took a hands-off approach in the belief that high-visibility strike intervention by previous administrations had undercut the collective bargaining process.

Moreover, the UMW of the old John L. Lewis days had become a shadow of its once mighty self. Its share of coal production in the country had plummeted to about half, down about 10 percent in only four years. It was crippled by internal divisions and inept leadership. Most states had mountainous stockpiles of coal - more than three months' supply for utilities, which consume three-fourths of all coal, and about the same for steel mills, which consume most of the rest.

But the mouse roared.

As the strike went into its second month, heavily coal-dependent states in Appalachia and the midwest began to experience coal shortages that threatened cutbacks by coal-burning electric power plants and job layoffs by major manufacturing centers in the nation's industrial hearthand.

By this week, the Energy Department was saying utility stockpiles in Maryland, Virginia, Ohio, West Virginia, Indiana, Kentucky, Missouri and Pennsylvania would run out by the end of April - some of them sooner. General Motors had started fuloughing workers, the Tennessee Valley Authority faced major power cutbacksin its seven-state service area, and the Labor Department said a total of 9,500 workers had been laid off by Feb. 18, principally in Indiana, Ohio and the Pittsburgh area.

Yesterday's meeting with the corporate chief executive officers - Edgar B. Speer of United State Steel, Lewis W. Foy of Bethleham Steel, George A. Stinson of National Steel, Howard W. Blauvel+ of Continental Oil and Nicholas T. Camicia of Pittston Co. - climaxed a gradually escalating presidential involvement that began with an effort to avert a premature UMW rejection of an approaching settlement early this month.

When the union's bargaining council did reject the pact, the industry, union and government were plunged into a fruitless round of bargaining that culminated in stalemate on Wednesday night.

Last weekend Carter, while exhorting both sides to settle their differences through negotiation, began to threaten "drastic action" meaning a back-to-work order, seizure or binding arbitration. The list was later expanded to include declaration of a bargaining impasse that would free each of BCOA's member companies to negotiate a settlement on its own.

Talking to reporters after the executives' meeting with Carter, Vice President Mondale and other top administration officials, Speer said he hoped for a settlement by the weekend but declined to be more specific. "One thing I can guarantee," he said, "there'll be some kind of contract."