In more than a quarter of a century as a fixture on US television, David Letterman has revelled in the peccadilloes and sexual indiscretions of countless public figures. Now it's his turn.

Last night, Letterman turned his legendary ironic wit on himself, revealing to an unprepared and frankly disbelieving TV audience that he had been the victim of a $2m (£1.25m) blackmail plot. Having delivered that bombshell, he went on to disclose that the extortion attempt had been made over his own "terrible" and "creepy" behaviour in which he had had sex with women who work in his CBS office.

Being Letterman, he finished the astonishing nine-minute monologue with a joke: "I know what you're saying. 'Well, be darned! Dave's had sex!'"

The double revelation of Letterman's at-work sexual practices and the blackmail plot against him left Manhattan's unflappable TV world stunned.

It comes as the comic is at the peak of his trade, his Late Show ahead in the Nielsen ratings against his late-night competitor, NBC's Conan O'Brien, and doing well against his arch-rival Jay Leno in his new 10pm slot.

Inevitably, as with any matter involving workplace sex, which has become a livewire issue in America, a question mark now hangs over Letterman's career. He recognised as much in his comments about what had happened, saying "I certainly need to protect my family ... I hope to protect my job."

The saga began at 6am on 9 September, when the 62-year-old comic got into his car and found a package waiting for him. According to the Manhattan district attorney, Robert Morgenthua, it was left by Robert Halderman, a CBS producer, who demanded a "large chunk of money" from the comedian in exchange for a "screenplay treatment" and supporting documents that detailed Letterman's behaviour. The package said: "Mr Letterman's world is about to collapse around him, leading to a ruined reputation and severe damage to his professional and married lives."

Letterman contacted his lawyer, and later the district attorney. Three meetings were arranged with Halderman, on 15, 23 and 30 September, in the course of which Halderman demanded $2m to keep the screenplay to himself. A cheque for that amount, with police approval, was handed to the blackmailer who cashed it into his bank account.