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.