President Carter won a major victory yesterday as the Senate rejected, 59 to 39, an attempt to scuttle the natural gas pricing compromise.

Supporters of the bill to end price controls on new natural gas by 1985 claim they now have the votes to pass it when the issue is put to an up-or-down vote next Wednesday. Opponents have another week to try to change it, but both Majority Leader Robert C. Byrd (D-W.Va.) and the bill's chief sponsor, Sen. Henry M. Jackson (D-Wash.), predicted that the bill is now out of danger and will pass the Senate.

In that case, the bill would go back for a final vote in the House, which has also started girding for a battle.

The bill is opposed by a coalition of pro-producer senators who want faster deregulation and pro-consumer senators who don't want it at all. They tried yesterday to send the bill back to a House-Senate conference with instructions to Senate conferees to try to strike out the pricing provisions, which are the heart of the bill. Their motion would have left only emergency power to waive price ceilings and special pricing provisions for Alaska gas, which is intended to make feasible private financing of an Alaska gas pipeline across Canada to the Midwest.

Jackson and other leading supporters said recommittal would kill the bill because House conferees have served notice they won't negotiate further on the issue, which had tied them up for eight months and which has divided Congress for 24 years.

"They made their maximum effort [on recommittal] today," Jackson said of the opposition after the vote. "They even threw in the Alaskan pipeline to try to get votes. We won't get 59 votes for the conference report, but we'll get a majority."

Sen. Howard M. Metzenbaum (D-Ohio), the leading pro-consumer opponent of the bill, refused to give up. He said he knew of at least five senators who will vote against the bill but voted against the motion to recommit. "We have to try to find a motion to recommit that has broader appeal," he said.

All Maryland and Virginia senators voted for the recommittal motion except for Charles McC. Mathias Jr. (R-Md.). He said he has not made up his mind how to vote on the merits of the bill, but did not want to kill it by a procedural move to send it back to conference.

The bill is not what Carter wanted when he sent up his omnibus energy program as his top priority domestic legislation 17 months ago. But the administration has embraced the conference agreement as the centerpiece of the energy program, apparently because it is the only major part remaining now that the former centerpiece, the tax on domestic crude oil, is considered dead.

Carter had asked that price controls be continued at a higher level and extended to cover the intrastate market of gas consumed in the state where produced. This accounts for more than 40 percent of national consumption. The House approved this, but the Senate voted to end controls after two years. It has taken House-Senate conferees nearly a year to find a compromise reconciling these opposing views, which involve billions of dollars.

The ceiling on new gas flowing through interstate pipelines is now $1.50 per thousand cubic feet (mcf). Under the compromise, the ceiling would go to $1.93 immediately and rise by about 10 percent a year until controls go off in 1985.

No senator expressed total satisfaction with the bill. Opponents contended it would mean price increases for consumers without any guarantee of additional production. Producer spokesmen said it would mean more regulation during the next seven years.

But supporters argued prices would go up with or without a bill and that the legislation would provide price certainly. They also contended it would bring more gas into the interstate market, by wiping out the unregulated intrastate market, and avoid shortages in cold winters. The administration also converted some members by arguing the bill was needed to shore up the dollar abroad and convince the world that the United States is serious about coping with impending energy problems.

The focus of attention will soon shift to the House, where the adminstration is again confronted with opposition from a coalition of right and left.

The White House already has begun to court House members - much as it has done with key senators - by hosting a series of breakfast meetings featuring Energy Secretary James R. Schlesinger, Federal Reserve Board Chairman G. William Miller and administration anti-inflation chief Robert S. Strauss. The first meeting was held last Friday.

At the same time, House Speaker Thomas P. (Tip) O'Neill Jr. (D-Mass.) has appointed a 40-member task force headed by Rep. Philip R. Sharp (D-Ind.) and broadly representative of House Democrats to conduct an educational campaign among wavering members. O'Neill has used this technique on other important bills and generally chooses an energetic, young House member as a leader. Sharp has worked on the gas bill since it was introduced.

House strategists also have decided to repackage the gas bill with the other parts of Carter's omnibus plan and offer it to House members for a single vote.

The Senate passed its version of Carter's energy package as five separate bills - natural gas, energy taxes, coal conversion, Utility rate revision and general conservation - and is giving final approval to the conference agreements as separate measures.

The House passed it as one bill on the theory it would be easier to put through one comprehensive package. Rep. Thomas L. Ashley (D-Ohio), who coordinated energy action as chairman of the House Ad Hoc Energy Committee, said the House plan to repackage the four parts not waiting for taxes - would put pressure on members to vote for the gas bill, because they would be only one energy vote; they couldn't vote against the gas bill and say they voted for three energy bills.