MANCHESTER, N.H. - Democratic presidential candidate Barack Obama told high school students yesterday that when he was their age he was hardly a model student, experimenting with illegal drugs and drinking alcohol.

Obama stopped by a study hall at Manchester Central High School and answered students' questions about the war in Iraq and his education plan for kindergarten through grade 12. The Illinois senator's plan aims to improve teacher pay, early childhood learning, and math and science test scores. It would cost upwards of $18 billion a year.

But when an adult asked about his time as a student, Obama spoke bluntly.

"I will confess to you that I was kind of a goof-off in high school as my mom reminded me," said Obama, who grew up in Hawaii. "You know, I made some bad decisions that I've actually written about. You know, got into drinking. I experimented with drugs. There was a whole stretch of time that I didn't really apply myself a lot. It wasn't until I got out of high school and went to college that I started realizing, 'Man, I wasted a lot of time.' "

In high school, his biggest interests were sports and girls, he said.

Obama has written about his drug use in his memoir, "Dreams from My Father." Mostly he smoked marijuana and drank alcohol, Obama wrote, but occasionally he would snort cocaine when he could afford it.

Drugs, Obama wrote, were a way he "could push questions of who I was out of my mind, something that could flatten out the landscape of my heart, blur the edges of my memory."

Obama told the students at Manchester Central, the state's most diverse high school, that he developed his sense of social justice when he was at college. He attended Occidental College in Los Angeles for two years before transferring to Columbia University in New York.

In his education plan, Obama said he wanted to move away from a "those kids" mentality [as in "those kids can't learn"] to one that a looks at every child as "our kid."

"We are the nation that has always understood that our future is inextricably linked to the education of our children - all of them," he said.

He also used the speech to criticize rivals Hillary Clinton and John Edwards for voting against more funding of President Bush's "No Child Left Behind" effort when they were both in the US Senate.

"It's pretty popular to bash 'No Child Left Behind' out on the campaign trail, but when it was being debated in Congress four years ago, my colleague Dick Durbin offered everyone a chance to vote so that the law couldn't be enforced unless it was fully funded," Obama said. "Senator Edwards and Senator Clinton passed on that chance, and I believe that was a serious mistake."

The Edwards and Clinton campaigns responded by accusing Obama of supporting the law while he was in the Illinois Legislature while opposing it now.

Edwards's camp said Obama was trying to "have it both ways," while Clinton's said Obama can't match her leadership and experience.

Obama's plan would encourage universal pre-kindergarten programs - but not require them - expand teacher mentoring programs, and reward teachers with increased pay not tied to standardized test scores.

His campaign said he would pay for the plan by delaying NASA's Constellation Program, which is developing the vehicle and rockets to go to the moon and later to Mars, by reducing costs by buying in bulk, by auctioning surplus federal property, and by cutting down erroneous payments identified by the Government Accountability Office.

Globe correspondent James W. Pindell contributed to this report.

© Copyright 2007 Globe Newspaper Company.