With one vote to spare, the Senate yesterday approved ratification of the first of two controversial Panama Canal treaties, giving President Carter an important victory.

A Republican senator from Okiahoma, a newly appointed Democrat from Montana and a veteran Democrat from Nevada gave the president his treaty, which he had called crucial to his credibility as a leader. The final vote was 68 to 32.

The treaty the Senate approved guarantees the neutrality and operation of the Panama Canal in perpetuity after the year 2000. The Senate still must act on a second treaty that will gradually turn the canal to Panama between now and 2000.

Though yesterday's vote was a great encouragement to this second treaty's supporters, it does not guarantee approval. At least half a dozen senators who voted "aye" yesterday publicly reserved the right to vote against the second treaty if it is not modified.

A telephone poll of the Senate conducted yesterday by ABC News showed 57 senators saying they support the second treaty, 27 declaring opposition, and 16 undecided. So another close fight seems inevitable.

Nevertheless, White House officials and the Senate leaders who led the fight for the treaty that was approved yesterday were clearly elated by the 68 to 32 vote, and several expressed the view that this was the hardest one to win.

To get that victory, treaty supporters had to accept two amendments to the treaty and a number of reservations, one of which has alarmed the government of Panama, though apparently not enough to endanger the treaty's acceptance by Panama.

After the Senate vote, President Carter read a statement to reporters hailing the victory as "a new and promising step" in relations with Latin American. To Panamanians, Carter said explicitly that the modified treaty does not give the United States the right to interfere in Panama's internal affairs.

Sen. Pual Laxalt (R. Nev.), the leader of antitreaty senators, said yesterday's vote had to be seen as a victory for the president, but he credited the Senate's majority and minority leaders - not the White House - with producing the margin of victory.

Laxalt and other conservatives promised to press the fight against the second treaty.

Sen. Robert C. Byrd ( D. W. Va.), the majority leader who played a crucial role personally in guiding the treaty to victory, said yesterday the urgument that carried the day with the last, critical undecided senators who finally voted "aye" was that defeat could cripple "the presidency" abroad and at home. Byrd was careful to distinguish between Carter personally and his office.

Byrd and other sources described how the two-thirds majority was finally assembled to win approval for the treaty.

For weeks, Bryd and the administration could only count 59 or 60 certain yes votes, and they needed 67. Early last week, Bryd met with four undecided Democrats in an attempt to find a way to break the impasse.

That meeting led to a series of luncheons and bargaining sessions which eventually produced six new affirmative votes, in return for certain changes in the Senate's resolution of ratification of the treaty.

These six senators were Georgians Sam Nuun and Herman E. Talmadge, Dennis DeConcini (Ariz.), Pual Hatfield (Mont.), Russell B. long (La.) and Howard W. Connon (Nev.). Cannon was not a member of the group, but Long - a key - was credited with convincing Cannon to join the two-thirds majority.

Two Republicans' decisions to vote yes were also crucial in the last week - those of Edward W. Brooke (Mass.) and Henry L. Bellmon (Okla.).

Byrd said those undecided Democrats were the ones who responded to his argument that rejected of the treaty could cripple the presidency.

The outcome was certified in a hushed Senate chamber yesterday afternoon. Suddenly the entire body of 100 was assembled - a rare event - and the clerk was calling the roll. At 4:27M Sen. Gaylord Nelson (D. Wis.) was the 67th member to say "aye."

The roll-call was not as tense as it might have been, because everyone in the room knew that the treaty had 67 supporters. The 67th, Hatfield of Montana, had declared its intention to vote yes on the floor several hours earlier.

The only surprise vote was that of Cannon, who had been expected to vote no. His colleague from Nevada, Laxalt, said Cannon had promised to vote no if his vote was needed to defeat the treaty.

However, Byrd said he had "three of four" senators lined up to cast the critical 67th vote, if they were needed to do so. In the end, they all voted no, Byrd said.

One of them was Jennings Randolph (D-W. Va.), who held his his peace the first time the clerk called his name. He was looking at a running tally of the vote being kept by his neighbor Russell Long. When it was obvious that his vote wasn't needed, Randolph, expressionless throughout, voted no.

Randolph faces a tough reelection fight, and told colleagues it would help him to vote no if he could.

Two Democrats whom the White House had wooded heavily decided yesterday to vote no: Wendell Ford (Ky.) and Edward Zorinsky (Nev.) They, too, might have been available if needed as yes votes, it appeared.

Before the final vote, the Senate adopted, 75 to 23, a reservation proposed by DeConcini that was the most discomfiting change the Senate forced on the Carter administration. The reservation spelled out America's right to take unilateral action, including the use of military force in Panama, after 2000 if the canal is closed for any reson.

The State Department has always said the more vague wording of the treaty itself assured this right, but DeConcini set it out explicity. Panamanian officals at various times in the past had used the treaty's vagueness to argue that Panama would have to agree on any use of American force in the country after 2000, but now there is no room left for that urgugment.

President Carter telephone Panama's leader, Gen. Omar Torrijos, late Wednesday to discuss this reservation with him, and to reassure him. Wednesday night, Deputy Secretary of State Warren M. Christopher called DeConcini to tell him about Panama's unhappiness with the reservation, and to ask him to reconsider it.

Yesterday morning DeConcini talked to Carter by phone and said he would not change the reservation. Carter said that was acceptable, DeConcini told reporters yesterday.

About a dozen liberal senators voted against the DeConcini reservation yesterday, apparently feeling that it was redundant and an affront to Panama. But it carried easily.

Administration officials were much heartened by the failure of an amendment to the reservation offered by Sen. James B. Allen (D. Ala.), an indepefatigable treaty foe. Allen's amendment to the text of the treaty.

This was defeated, 62 to 36. Administration officials said this vote would help them persuade Panamanian officials that the reservation was not the same as an amendment, so Panama could accept it without difficulty.

(In recent weeks, a number of international lawyers and legal scholars have told The Washington Post that a reservation like DeConcini's would be as binging on Panama as an amendment to the text, provided Panama accepts it.)

Sen. Robert Griffin (R. Mich.), a leading treaty opponent, argued yesterday that if Panama does not hold a new plebiscite on the revised version of the treaty approved by the Senate, the pact could be renounced by some future Panamanian leader as invalid.

Panama's constitution says a plebiscite must be held on any treaty with the United States concerning the canal, and a plebiscite was held in October. Both Torrijos and Carter have hoped to avoid the need for a second plebiscite, but it is up to Torrijos to decide what make that necessary.

Griggin proposed that the Senate send the treaty back to Carter for renegotiation. Sen. Frank Church (D. Idaho), who was the floor leader for the treaty, said this would amount to inviting a war, and a motion to that effect by Giffin was defeated, 67 to 33.

By voice vote, the Senate approved a reservation proposed by H. John Heinz III (R. Pa.), setting out the Senate's view that Panama must use the revenues it will receive from the canal first of all to keep it in good working order, leaving only surpluese after maintenance costs for other purposes.

In the closing hour of debate, both sides made final pleas. But the opponents all conceded defeat, and there was no need for a rousing speech from Byrd for the proponents, so the hour was less than stirring.

Minority Leader Howard H. Baker Jr. (R. Tenn.) used his time to refute the proposition that public opinion in the country overwhelmingly opposes the canal treaties. His own poll in Tennessee and "all my instincts as a politican," Baker said, convince him that although there is widespread opposition, a majority of the population approves of America doing "the right thing" by approving the treaties.

Byrd praised the sincerity of proponents and foes alike in a closing speech that typified the good manner and general humor of the debate so far.

In fact, the debate has not done much to change senator's minds, though it has gone on since early February. The first roll call vote on the treaties - on a procedural issue, though it had symbolic importance as a bellwether - was virtually identical with yesterday's final vote. Only one senator - William V. Roth Jr. (R. Del.) - changed his mind in the intervening weeks.