Pete Doherty is to have an implant surgically inserted into his body to help wean him off drugs, the singer told a British court Thursday.

Doherty, the former boyfriend of supermodel Kate Moss, told Thames Magistrates' Court he wants to have the device fitted within the next two weeks. He was appearing at a review of his progress in drug rehabilitation.

He tried unsuccessfully to have an implant inserted while being treated for drug addiction at a Portuguese rehab clinic last month. The implant will chemically inhibit the effects of opiates, like those in heroin, and would be used to manage Doherty's dependence on drugs.

The 27-year-old singer was two hours late for the court appearance in east London. The Babyshambles frontman — and former lead singer of the Libertines — wore his signature suit and hat and greeted fans outside of the court, one of whom presented him with a blue guitar signed by dozens of admirers.

Inside, Judge Jane McIvor told Doherty, who represented himself, that while both she and his doctors were pleased with his progress, she was still waiting for his first negative test result.

"You are going in the right direction. It's not easy, especially in your circumstances. I appreciate that entirely," McIvor said. "I think your concentration should be, within six months of the order, to get a negative test."

Doherty said he was disappointed that his last test was not negative: "Maybe next time round."

The case was adjourned until September, when another review of Doherty's treatment and test will take place.

The rocker is undergoing drug treatment at the order of the court following a December arrest, in which police discovered marijuana, heroin and crack cocaine in his car and clothing.

Doherty was again arrested April 20, after which he was placed on probation and ordered to participate in an 18-month drug rehabilitation program. His drug habit gained international attention after a British tabloid printed pictures of Moss allegedly using cocaine at a music studio where Doherty and his band were recording. Charges against the model were dropped last month.