Environmentalists won a major victory yesterday in their long-running confrontation with Interior Secretary James G. Watt as the House voted overwhelmingly to ban oil and gas leasing in the nation's wilderness areas.

By 340 to 58, the House approved a bill that would bar heavy exploratory drilling in the areas permanently unless Congress and the president agreed to reopen them for exploration.

It was the third legislative setback in two days for industry groups.

In approving a two-year extension of the federal pesticide control law Wednesday, the House voted down a series of amendments backed by chemical manufacturers.

Also on Wednesday, in a House committee markup on extending the Clean Air Act, an industry-supported amendment on hazardous air pollutants lost to one promoted by a coalition of environmental and health groups.

Faced with massive bipartisan support for the wilderness bill, Watt and the White House had taken no position on the measure. But earlier Watt had favored one that would have reopened the leasing issue in the year 2000.

If the bill becomes law, leasing would be barred in about 33 million acres of wilderness lands, almost all of them in western states. It would not affect Alaskan wilderness areas, which are governed by separate law.

That would end a contentious dispute which began last year when Watt indicated he would reverse a policy followed since 1964 and open wilderness areas to oil and gas exploratory drilling.

He claimed the law establishing those areas gave him no option, an interpretation sharply challenged by congressional committees and environmental groups.

The bill had been opposed by the oil and gas industry. More than 1,000 lease applications had been filed in anticipation of exploring for deposits in western states.

With the administration on the sidelines, only a handful of House members expressed opposition, contending the bill would curtail the search for energy sources that will be needed in the event of another world oil shortage.

Rep. Don Young (R-Alaska) charged that members had been "misled" by environmental group pressures and would regret their votes when next confronted by "cold homes and long lines at the gas pumps."

The measure approved yesterday would permit exploration for the purpose of gathering information on mineral deposits if the methods used do not disturb the wilderness environment.

Young tried to amend it to permit the use of explosives during seismic exploration but this was defeated, 281 to 115, after opponents claimed that explosions would disturb wildlife.

Young also offered an amendment that would have excluded lands being considered for wilderness purposes, but lost on a voice vote.

Such a change would have opened the land to road-building and drilling rigs before Congress could decide whether to protect them permanently, Rep. John F. Sieberling (D-Ohio), chairman of an Interior subcommittee and chief author of the bill, said.

Watt ran into a hornet's nest of criticism on Capitol Hill when he disclosed that his department would consider granting lease applications, claiming he had no choice under the 1964 law.

House Democrats and environmental groups were joined, unexpectedly, by a number of conservative western Republicans who found themselves pressed by constituents who objected to the threat of large-scale exploration and development.

More than 3 million acres of wilderness in the West were targeted by lease applications, and amid the controversy it was discovered that two leases in the El Capitan wilderness region of New Mexico had been approved.

All the members of Congress from Maryland voted for the bill. All Virginia congressmen voted for it except Democrat Dan Daniel and Republicans M. Caldwell Butler, J. Kenneth Robinson and William C. Wampler.