(Reuters) - Major tobacco companies that spent decades denying they lied to the U.S. public about the dangers of cigarettes must spend their own money on a public advertising campaign saying they did lie, a federal judge ruled on Tuesday.

The ruling sets out what might be the harshest sanction to come out of a historic case that the Justice Department brought in 1999 accusing the tobacco companies of racketeering.

U.S. District Judge Gladys Kessler wrote that the new advertising campaign would be an appropriate counterweight to the companies' "past deception" dating to at least 1964.

The advertisements are to be published in various media for as long as two years.

Details of the campaign - like how much it will cost and which media will be involved - are still to be determined and could lead to another prolonged fight.

Kessler's ruling on Tuesday, which the companies could try to appeal, aims to finalize the wording of five different statements the companies will be required to use.

One of them begins: "A federal court has ruled that the defendant tobacco companies deliberately deceived the American public by falsely selling and advertising low tar and light cigarettes as less harmful than regular cigarettes."

Another statement includes the wording: "Smoking kills, on average, 1,200 Americans. Every day."

The wording was applauded by health advocates who have waited years for tangible results from the case.

"Requiring the tobacco companies to finally tell the truth is a small price to pay for the devastating consequences of their wrongdoing," said Matthew Myers, president of the Campaign for Tobacco-Free Kids, an anti-tobacco group in Washington.

The major tobacco companies, which fought having to use words like "deceived" out of concern for their free speech rights, had a muted response.

"We are reviewing the judge's ruling and considering next steps," said Bryan Hatchell, a spokesman for Reynolds American Inc.

Philip Morris USA, a unit of Altria Group Inc, is studying the decision, a spokesman said. A spokesman for a third major defendant, Lorillard Inc, had no immediate comment.

The Justice Department, which urged the strong language, was pleased with the ruling, a spokesman said.

Kessler's ruling considered whether the advertising campaign - known as "corrective statements" - would violate the companies' rights, given that the companies never agreed with her 2006 decision that they violated racketeering law.

But she concluded the statements were allowed because the final wording is "purely factual" and not controversial.

She likened the advertising campaign to other statements that U.S. officials have forced wayward companies to make.

The Federal Trade Commission, she wrote, once ordered a seller of supposed "cancer remedies" to send a letter on its own letterhead to customers telling them the commission had found its advertising to be deceptive.

"The government regularly requires wrongdoers to make similar disclosures in a number of different contexts," Kessler wrote.

Early in the long-running case, the Justice Department hoped to extract $280 billion from the companies to pay for a smoking cessation program and other remedies.

It later dropped the demand to $14 billion, and then Kessler ruled she could not force them to pay for such a program at all.

Tobacco companies are separately battling in court with the U.S. Food and Drug Administration (FDA) over the warning labels on tobacco products. The FDA has proposed new, graphic warning labels - one of which includes a photo of a man with a hole in his throat - that companies consider a free speech violation.

When Kessler first ordered the advertising campaign in 2006 - setting off six years of debate on the wording - the statements were to run on major television networks, in cigarette packaging, as full-page newspaper ads and on corporate websites.

The idea was to "structure a remedy which uses the same vehicles which defendants have themselves historically used to promulgate false smoking and health messages," she wrote then.

But in the years since, "the types of media in which defendants convey commercial messages of this nature have changed dramatically," Kessler wrote on Tuesday.

Perhaps, she added, the ads should also be in the online versions of newspapers.

The case is USA v. Philip Morris USA, et al, U.S. District Court for the District of Columbia, No. 99-cv-02496.

• The Surgeon General has determined that there is no safe level of exposure to ambient smoke!

• If you smell even a subtle odor of smoke, you are being exposed to poisonous and carcinogenic chemical compounds!

• Even a brief exposure to smoke raises blood pressure, (no matter what your state of health) and can cause blood clotting, stroke, or heart attack in vulnerable people. Even children experience elevated blood pressure when exposed to smoke!

• Since smoke drastically weakens the lungs' immune system, avoiding smoke is one of the best ways to prevent colds, flu, bronchitis, or risk of an even more serious respiratory illness, such as pneumonia or tuberculosis! Does your child have the flu? Chances are they have been exposed to ambient smoke!