Boris Johnson confirmed that he snorted cocaine and smoked drugs as a teenager.

The Conservative candidate for mayor of London confessed in an interview that he had taken cocaine when he was 19 and studying at Oxford. He said he had smoked “dope” before that.

His admissions, which he has alluded to before but never fully confirmed until now, were revealed in an interview with Janet Street-Porter for Marie Claire magazine.

When asked by Street-Porter about his previously jokey references to cocaine use, Johnson replied: “Well, that was when I was 19. It all goes to show that sometimes it’s better not to say anything. I thoroughly disagree with drugs. I don’t want my kids having drugs.”

The Henley MP was referring to an appearance in 2005 on the TV quiz Have I Got News For You in which he said: “I think I was once given cocaine, but I sneezed and so it did not go up my nose. In fact, I may have been doing icing sugar.”

Asked in the same interview whether he had smoked “dope” before university, Johnson replied: “That’s true, but the stuff you and I may have smoked is not the same as what the kids are having now. I think skunk [a potent form of cannabis] and this stuff is very, very dangerous.”

Johnson’s comments come after the revelation that Ken Livingstone, the Labour incumbent as London mayor, has fathered five children by three women.

The Tory candidate’s election campaign has so far been carefully managed so that Johnson, whose outspokenness has caused him embarrassment in the past, could avoid making comments that might harm his chances of ousting Livingstone at City Hall.

The Guardian yesterday published the results of the most precise opinion poll on the elections yet showing that the Tory was ahead of Livingstone by a slender 2% margin.

His confession will also put pressure on his party leader, David Cameron - Johnson’s friend from their time together at Eton school and Oxford University - to come clean about his own drug use.

When quizzed about drugs, Cameron has always maintained he had “normal student experience”. He has failed to deny claims in a biography he had come close to being expelled for using cannabis at Eton.

Last year, virtually the entire cabinet admitted they had smoked cannabis after the home secretary, Jacqui Smith, revealed that she had experimented with it as a youngster.

Everyone from Hilary Benn to Lords leader Lady Ashton confessed to having dabbled with the drug.

The only minister who refused to comment at the time was the then-culture secretary, James Purnell.