With just hours left in office, President Clinton reached a deal with the independent counsel yesterday that ensures he will avoid indictment for his misleading statements about Monica S. Lewinsky. In exchange, Clinton offered prosecutor Robert W. Ray something he had never before been willing to give: a forthright admission that he gave false testimony under oath.

As a separate part of Clinton's effort to put the legal aftershocks of a sex scandal behind him, he reached an agreement with Arkansas authorities that spares him the humiliation of being stripped of his law license. Clinton agreed to pay $25,000 in fines and, in a symbolic penalty for a man with no plans to return to the bar, accepted a five-year suspension of his license.

"I tried to walk a fine line between acting lawfully and testifying falsely, but I now recognize that I did not fully accomplish this goal and that certain of my responses to questions about Ms. Lewinsky were false," Clinton said in a statement, which closed by saying, "I hope my actions today will bring closure and finality to these matters."

The timing was not incidental: Ray, sources said, had during weeks of negotiations insisted that Clinton acknowledge wrongdoing while still president, though neither side anticipated that the deal would come on his last full day in office. Clinton also agreed that he will not seek government reimbursement of his legal bills, which total several million dollars, as people who are cleared of wrongdoing during independent counsel inquiries are allowed to do.

Clinton did not meet his own deadline for dealing with a host of other legal controversies: the scores of pardon requests before him, including some from key Whitewater figures, including Susan B. McDougal and former Arkansas governor Jim Guy Tucker. White House officials said Clinton would make pardon announcements this morning, just hours before heading to the Capitol for President-elect Bush's inauguration.

Yesterday's flurry of last-minute legal bargains seems to guarantee that the scandals that shadowed so much of Clinton's time in office -- and led to his impeachment -- will not live beyond his presidency. Ray had said he was considering whether to indict Clinton for committing perjury in the Paula Jones sexual harassment case, and questions about the merits of a pardon were stirring controversy for Bush.

"I think it's a collateral benefit to the country that the new president be given a fresh start if that can be achieved," Ray said in an interview last night. "The best interests of the country would be achieved by letting the past be the past."

The twin bargains with Ray and the Arkansas Supreme Court Committee on Professional Conduct were reached during extensive negotiations with the president's private attorney, David Kendall. "This is an appropriate closure for the country and the president," Kendall said.

Neither Ray nor Kendall would say who initiated the talks. But there was plainly an element of brinkmanship on all sides. Clinton had repeatedly stated in public that he did not fear indictment or want a pardon.

But the prospect of fighting a criminal charge that sources said looked increasingly likely -- even if he won acquittal -- was unpalatable. The possibility of an indictment appeared to increase in early December after Ray initiated a meeting with Lewinsky and told her she might be called before a grand jury, her lawyer Plato Cacheris said yesterday.

Ray was eager to bring closure to a case that has taken years and cost millions of dollars, but he found no provable lawbreaking by the Clintons beyond coverup of an affair. However, he also wanted to uphold the principle that even presidents face consequences for misleading a judicial proceeding. So both sides got a measure of what they wanted.

"Ray got an admission of what everybody knew all along, and got the law license," Cacheris said. "And Clinton avoided getting indicted."

But, for Clinton, at considerable cost. His aides said he agreed to the five-year license suspension reluctantly and believes it is more severe than the circumstances deserve. On a symbolic level, one last day of overshadowing legal developments -- during an eight-year tenure filled with such moments -- was hardly the way he wanted to close his presidency.

Even so, with the White House walls and many offices empty and Clinton busy in the residence packing up his personal belongings, there was a haunting sense of coming full circle. It was nearly nine years ago, in his first presidential campaign, that Clinton and Hillary Rodham Clinton were first buffeted by questions about their investment in a failed land development called Whitewater. Following a tortuous path across the years, the questions about financial dealings spawned an independent counsel and eventually transmuted into a case about sex -- specifically whether the president committed perjury and sought to obstruct justice in the Jones sexual harassment case.

It was three years ago this week, in a sworn deposition with Jones and U.S. District Judge Susan Webber Wright in attendance, that Clinton denied having a sexual relationship with Lewinsky (who, after conversations with Clinton and presidential friend Vernon Jordan, also submitted an affidavit denying an affair). He also denied having been alone with her. Ten months later, in a nationally televised speech, he acknowledged an "inappropriate" relationship with Lewinsky and angrily condemned Ray's predecessor, Kenneth W. Starr, for invading private lives.

Yesterday, he went further than he ever had in a succession of statements and apologies, conceding that his wrongdoing was of a legal nature, not merely a personal lapse.

For instance, at the time his lawyers were laboring to prevent impeachment before the House they acknowledged that "reasonable people" might conclude that Clinton's evasions in the Jones case crossed the line into falsehood. But Clinton never said that, much less acknowledged falsehood. Earlier this year, he paid a contempt fine of $90,000 levied by Wright, he said, solely to dispense with the matter, not because he agreed that he had lied.

In yesterday's statement Clinton effectively acknowledged that there is no reasonable interpretation by which his testimony was anything but false.

Clinton, moreover, had previously maintained that his efforts to evade being pinned down about Lewinsky by the Paula Jones lawyers were a legal tactic -- a legitimate response to a suit he argued was illegitimate and politically motivated.

Yesterday, in resolving the disbarment case, he agreed that such evasions were not a legitimate tactic. "Mr. Clinton's conduct . . . caused the court and the counsel for the parties to expend unnecessary time, effort, and resources," said a consent order that Clinton signed. "It set a poor example for other litigants, and this damaging effect was magnified by the fact that at the time of his deposition testimony, Mr. Clinton was serving as President of the United States."

Yet even these new admissions will not be accepted by skeptics as evidence that Clinton has finally told the truth. For example, while Clinton has acknowledged falsehood in the Jones case, he maintains that his grand jury testimony in August 1998 was truthful. Clinton "believes that that testimony was in no way evasive, misleading or false," said White House spokesman Jake Siewert.

That grand jury testimony pivoted in part on questions of whether Clinton had ever lied under oath about having "sexual relations" with Lewinsky as that term was defined in the Jones case. The definition, imposed in advance of the deposition by Wright so that testimony could avoid clinical details, included not just intercourse but fondling and all other erotic contact with genitals and breasts. By this definition, Clinton asserted to Starr's prosecutors, Lewinsky's oral sex acts on him constituted sexual relations, but his receipt of her favors did not.

But to believe that even this legalistic explanation could be technically truthful, one must believe that in the course of their half-dozen encounters Clinton never engaged in sex play with Lewinsky -- and disbelieve her detailed testimony of several intimate encounters.

Yet even many Republicans, while disbelieving Clinton, have concluded that two years after impeachment ended in his acquittal, the public is in little mood for a prosecution hinging on such arcane and embarrassing definitions of what qualifies as sex and what constitutes a lie. Rep. Robert L. Barr Jr. (R-Ga.), one of Clinton's harshest congressional critics, said he was ready to "stop focusing on President Clinton's actions in the past" and let the new administration begin the work of "returning respect to the presidency."

Ray said that the agreement provided a reasonable alternative to prosecution. From his standpoint, he said that was achieved through the acknowledgments made by Clinton, the five-year suspension of his law license, the $25,000 fine, and the promise not to seek recovery of his legal fees. "Prosecution is a sledgehammer," he said. "It's the option of last resort, not first resort."

The timing of the agreement was critical, Ray said, noting that he had vowed early on to make a decision about charges very shortly after Clinton left office. Other sources said that Ray had frequently noted that President Gerald R. Ford's early weeks in office were consumed by debate leading to his pardon of Richard M. Nixon.

Reaching a deal required accepting some ambiguity about just what Clinton was acknowledging -- fitting perhaps in a case that always involved agonizing arguments about definitions of sex and lies. At a news conference, Ray heralded how Clinton admitted he "knowingly gave evasive and misleading answers" in the Jones case in violation of Wright's pre-deposition order for truthful testimony. This is accurate, but Kendall emphasized another point: that Clinton did not "knowingly" lie. Walking the line between truth and falsehood was a "dangerous and risky exercise," Kendall wrote Ray yesterday, but Clinton "can in conscience" say that "he tried to avoid testifying falsely."

The deal brings an end to the activities of Ray's office, but it is not the final word on the Whitewater or Lewinsky matters. That will come with the release of voluminous reports prepared by the independent counsel's office; those reports will be reviewed first by the three-judge Special Division that has overseen the office.

At a news conference, independent counsel Robert W. Ray announces his decision to conclude his investigation of President Clinton in the Monica S. Lewinsky matter.