Presidential hopeful Barack Obama on Tuesday told high school students 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. 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, an Illinois Democrat who grew up in Hawaii.

Get Breaking News Delivered to Your Inbox

"You know, I made some bad decisions that I've actually written about. You know, got into drinking. I experimented with drugs," he said. "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."'

Obama has written about his drug use in his memoir, "Dreams from My Father."

"Junkie. Pothead. That's where I'd been headed: the final fatal role of the young would be black man," Obama wrote. 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 students he developed his sense of social justice at college - he attended Occidental College in Los Angeles for two years before transferring to Columbia University in New York. Before he got to Columbia, he said, he lived a naive life.

"I went to high school in Hawaii, so there was a lot of opportunity to goof off because the weather is really good all the time," he said. "I did well in school, but I didn't really apply myself. I did what I needed to do to get into college and it came fairly easily to me."

His biggest interest was in sports and girls.

"I was big on basketball. We were state champs. I thought I was better than I was," said Obama, who finds time on the campaign trail to still play a pickup game.

He then added: "I thought about girls a lot, I won't lie."

Republican presidential candidate Rudy Giuliani was asked about Obama's comments while campaigning in Illinois. CBS News' Ryan Corsaro reports that when he was asked if he feels it was appropriate for Obama to talk about his drug use in the past with high school students, Giuliani said he did.

"I respect his honesty in doing that," Giuliani said. "I think one of the things that we need from people who are running for office is not this pretense of perfection. And the reality is all of us who run for public office whether its governor, legislature, mayor, president - we're all humans beings. If we haven't made mistakes, don't vote for us. Cause we're gonna have some big ones that are going to happen, unfortunately. And we wouldn't know how to handle them!"