But kicking the prohibitionist habit, it turns out, is no easy task. Even here in a small, progressive country of 3.3 million people, the president’s proposal has hit a gust of opposition. Doctors, political rivals, marijuana users and security officials have all expressed concern about how marijuana would be managed and whether legalization, or something close to it, would accelerate Uruguay’s worsening problem of addiction and crime.

Mr. Mujica, 78, a bohemian former guerrilla who drives a 1981 Volkswagen Beetle, seems to be surprised by the response. He said this month that if most Uruguayans did not understand legalization’s value, he would suspend his plan while hammering out the details and building public support. But this is a defiant leader who spent more than a decade in jail as a political prisoner, so even as he discussed postponement, he signaled that he might not be willing to give up, emphasizing that drug users “are enslaved by an illegal market.”

“They follow the path to crime because they don’t have the money,” he said, “and they become dealers because they have no other financial means to satisfy their vice.”

His government, which has a slim majority in Parliament, is moving forward. One of the president’s advisers said this month that draft legislation would be submitted within a few weeks, and Mr. Calzada, among many others, has been hard at work. His desk is covered with handwritten notes on local drug markets. A career technocrat with the long, wispy hair of an aging rocker, he said he had been busy calculating how much marijuana Uruguay must grow to put illegal dealers out of business. He has concluded that with about 70,000 monthly users, the haul must be at least 5,000 pounds a month.

“We have to guarantee that all of our users are going to be able to get a quality product,” he said.

He added that security would be another challenge. Drug cartels protect their product by hiding it and with the ever-present threat of violence. Uruguayan officials, including Mr. Sabini — one of several lawmakers who openly admits to having smoked marijuana — favor a more neighborly approach. They imagine allowing individuals to cultivate marijuana for their own noncommercial use while professional farmers provide the rest by growing it on small plots of land that could be easily protected.

The government would also require users to sign up for registration cards to keep foreigners away — an idea influenced by a new policy in the Netherlands, which restricts marijuana sales to residents — and to track and limit Uruguayans’ purchases (to perhaps 40 joints a month, officials say). Finally, there would be systems set up to regulate the levels of THC, the active ingredient in marijuana, and levy taxes on producers, relying for enforcement on the agencies regulating tobacco, alcohol and pharmaceuticals.