The Senate agreed last night to vote on the Supreme Court nomination of Judge Robert H. Bork by no later than 2 p.m. today, when it is all but certain to reject the nomination after an extraordinarily bitter battle over the high court vacancy.

Senate Majority Leader Robert C. Byrd (D-W.Va.) announced the agreement after a day of maneuvering in which many of Bork's Senate supporters joined with his opponents in seeking to force the nomination to a vote today. Bork also intervened in the process, signaling his desire to end the debate this week.

Senate Minority Whip Alan K. Simpson (R-Wyo.) quoted Bork as saying he had no desire to see the debate prolonged into next week. Simpson, who said he visited Bork yesterday, also quoted him as saying that he "deplores" advertising in some states attacking senators who oppose the nomination.

The advertising campaign targeted at Bork opponents such as Sen. Howell Heflin (D-Ala.) began as the nomination fight moved to the Senate floor, where the debate has been dominated by charges and countercharges over pro- and anti-Bork advertising.

Two more Republicans -- Sens. William V. Roth (Del.) and Frank H. Murkowski (Alaska) -- announced yesterday that they will vote to confirm Bork. But Sen. Sam Nunn (D-Ga.), a leading southern Democrat, said last night that he will vote against him, raising to 55 the number of senators who are publicly committed to oppose the nomination.

Nunn said his opposition was not based "on even 90 percent certainty," but that he remained unconvinced that Bork would maintain the more moderate views he expressed on some issues during the confirmation hearings.

"There is a considerable risk that Judge Bork's intellectual adventure might leave common sense and justice outside the door of the Supreme Court," he said.

Sources on both sides of the battle said Sen. Gordon J. Humphrey (R-N.H.) was the last holdout to the agreement to vote today. There were also mounting complaints on Capitol Hill yesterday about the backstage role played in the debate by Washington lawyer Leonard Garment, who launched a last-minute, free-lance campaign attacking the confirmation process and encouraging continuation of the dispute.

Garment, a White House aide under former president Richard M. Nixon, confirmed yesterday that he has been urging Bork's hard-core Senate supporters to continue the debate into next week. He said that it was "unthinkable" to vote on the nomination today and that more time was needed to prove that the Senate Judiciary Committee report on the Bork confirmation hearings was "basically a fraud."

"The whole thing will be shredded before we're through," Garment said.

In a letter published yesterday in The New York Times, Bork distanced himself from Garment's assault on the confirmation process.

"Mr. Garment is a friend of long standing," Bork wrote, "but he is not my adviser. Nor is he, as reported elsewhere, my lawyer or spokesman. I value his friendship and appreciate his efforts to aid me, but his activities are not coordinated with me, and he is in no sense my agent."

Garment played no known role in Bork's preparations for the confirmation hearings. On his own initiative, he first surfaced in the fight in a Oct. 5 New York Times report in which he quoted Bork as saying he would not ask that the nomination be withdrawn. In a brief telephone interview yesterday, Bork confirmed that Garment was authorized to make that statement, but said otherwise he has acted on his own.

Garment played a leading role in another Times report of assertions that a Judiciary Committee staff lawyer who works for Sen. Howard M. Metzenbaum (D-Ohio) may have attempted to intimidate a black law professor from testifying in favor of Bork at the committee hearings.

Garment said he passed this allegation on to Times columnist William Safire, who worked with him in the Nixon White House. Safire and Times reporter Martin Tolchin later interviewed the staff lawyer, Linda Greene, and reported the allegation and her denial. Baker has publicly denied that his decision not to testify resulted from pressure by Greene.

Humphrey referred to this incident yesterday in attacking Bork's critics. He said it "was not surprising that an unethical act of scandalous proportions arose out of the atmosphere of fear and hysteria that was deliberately created by irresponsible Bork opponents."

Apparently acting on his own, Garment has flooded news organizations with pro-Bork material. After The Times quoted him as speaking for Bork, Garment was interviewed on several television programs. His appearance on ABC's "Nightline" program led to an invitation from Godfrey Sperling of the Christian Science Monitor to a regular breakfast Sperling hosts for reporters and public figures.

Last weekend, Garment circulated a petition at a judicial conference, written by him and his wife Suzanne, that decried the lobbying surrounding the nomination. On Wednesday, the first day of debate, the petition, signed by 23 federal judges from New York, was cited by Sen. Orrin G. Hatch (R-Utah), a staunch Bork supporter.

During the Bork debate, he has also stalked the Senate Press Gallery, from which he was officially barred Wednesday.

Bork declined yesterday to discuss Garment's activities, but a friend of Bork, who asked not to be identified, indicated there was deep dissatisfaction with Garment among other Bork loyalists.

"My only concern is what's good for Bob Bork," he said. "He's gone through hell."

Garment said yesterday that about 15 volunteer lawyers in New York were producing rebuttals to the Judiciary Committee report. He said they "will savage the majority report," which he called "the work of third-rate lawyers."

Garment said he wanted the Senate floor debate to last until Wednesday to give the lawyers time to complete 10 briefs attacking sections of the Judiciary Committee report.

The first of those briefs were delivered Wednesday to Simpson's office for distribution to other senators and the Press Gallery. The first of the material was distributed in the Senate Press Gallery last night.