Under the settlement, the Times also allowed the lawyers for Vicki Iseman, the Washington lobbyist who filed the suit against the newspaper, to publish a statement on the Times website.
Iseman filed suit against the Times after it ran a front-page article on February 21, 2008 that mentioned her ties with the Arizona senator, who at the time was the favorite to win the Republican presidential nomination.
The article discussed McCain's relations with lobbyists in Washington and in particular his relationship with telecommunications industry lobbyist Iseman.
It said some top advisers to McCain had become convinced during his previous bid for the presidency in 1999 that "the relationship had become romantic."
The article, coming in the midst of the presidential campaign, caused a furor and both McCain and Iseman denied that they had an affair.
Among those criticizing the article was the public editor of the Times, Clark Hoyt.
"If a newspaper is going to suggest an improper sexual affair, whether editors think that is the central point or not, it owes readers more proof than The Times was able to provide," he wrote.
In its "note to readers," the newspaper said: "The article did not state, and The Times did not intend to conclude, that Ms. Iseman had engaged in a romantic affair with Senator McCain or an unethical relationship on behalf of her clients in breach of the public trust."
Iseman's lawyers, in the statement published on the Times website, called for a public debate on "drawing the proper balance between the need for free and open public disclosure and the privacy rights of individuals."
In a response, Times executive editor Bill Keller said the lawsuit "was settled without money changing hands, and without The Times backing away from the story."
"We stand by our coverage, and we are proud of it," he said. "We are confident that if they had been tested in court, the plaintiff's arguments would have failed on the merits."