Escalating its efforts to portray Senator Barack Obama as a candidate whose values fall outside the mainstream, the campaign of Senator John McCain on Tuesday unveiled a new television advertisement claiming that Mr. Obama, the Democratic nominee, favors “comprehensive sex education” for kindergarten students.

“Learning about sex before learning to read?” the narrator asks in the 30-second advertisement, which the campaign says will be shown in battleground states and on national cable. The commercial also asserts that a sex-education bill introduced in Illinois, which Mr. Obama did not sponsor and which never became law, is his “one accomplishment” in the field of education.

Both sets of accusations, however, seriously distort the record.

The original controversy dates to 2003, when a bill to modify the teaching of sex education in Illinois was introduced in the Legislature. The proposal was supported by a coalition of education and public health organizations, including the Illinois Parent Teacher Association, the Illinois State Medical Society, the Illinois Public Health Association and the Illinois Education Association.

Mr. Obama voted for the bill in committee, where it passed, but it never came to a full and final vote. The proposal called for “age and developmentally appropriate” sex education and also allowed parents the option of withdrawing their children from such classroom instruction if they felt that it clashed with their beliefs or values.

In referring to the sex-education bill, the McCain campaign is largely recycling old and discredited accusations made against Mr. Obama by Alan Keyes in their 2004 Senate race. At that time, Mr. Obama stated that he understood the main objective of the legislation, as it pertained to kindergarteners, to be to teach them how to defend themselves against sexual predators.

“I have a 6-year-old daughter and a 3-year-old daughter, and one of the things my wife and I talked to our daughter about is the possibility of somebody touching them inappropriately, and what that might mean,” Mr. Obama said in 2004. “And that was included specifically in the law, so that kindergarteners are able to exercise some possible protection against abuse, because I have family members as well as friends who suffered abuse at that age.”

It is a misstatement of the bill’s purpose, therefore, to maintain, as the McCain campaign advertisement does, that Mr. Obama favored conventional sex education as a policy for 5-year-olds. Under the Illinois proposal, “medically accurate” education about more complicated topics, including intercourse, contraception and homosexuality, would have been reserved for older students in higher grades.

The advertisement, then, also misrepresents what the bill meant by “comprehensive.” The instruction the bill required was comprehensive in that it called for a curriculum that went from kindergarten and through high school, not in the sense that kindergarteners would have been fully exposed to the entire gamut of sex-related issues.

An error has occurred. Please try again later.

You are already subscribed to this email.

In another part of the advertisement, Mr. McCain maintains that Mr. Obama’s sole achievement in education was the sex-education bill. In reality, Mr. Obama not only helped administer a $49 million education project in Chicago in the 1990s, but also sponsored or co-sponsored measures that increased the number of charter schools in Illinois, and expanded federal grants to summer school programs and to historically black colleges.

As support for its contention that Mr. Obama is “wrong on education,” Mr. McCain’s advertisement cited criticism by Education Week, a trade publication. Mr. Obama “hasn’t made a significant mark on education” in his years in the Senate in Illinois and Washington, the advertisement asserts.

Education Week did indeed make that assessment in an article published last year. But in the same paragraph, the magazine also said that Mr. Obama “did promote early-childhood initiatives that advocates considered “innovative and progressive,” and also noted that “his biggest accomplishment in the field was the creation of a state board to oversee the expansion of early-childhood education in the state.”

The same publication has also criticized Mr. McCain, in language that was perhaps even stronger. Early this year, in an article titled “John McCain Where Art Thou?” it complained that he offered “a laundry list of fairly vague answers” on how to improve schools and did not make education a priority.

“McCain is a campaign-finance, foreign-relations, anti-abortion, tax-cut candidate,” the magazine said. “Education is not his thing. Depending on your perspective, McCain’s relative silence on education may be a good thing. If you think the federal government has grossly overreached into the state business of education, then he may be your guy.”

The Obama campaign expressed outrage over the commercial, with Bill Burton, a spokesman, describing it as “shameful and downright perverse.”