Delegates for the hard-line socialist Left, Die Linke, voted 211 in favour and 173 against, with 29 abstentions, to endorse a full-legalisation policy.
"We advocate a rational and humane drug policy," German daily Die Welt quoted the program as stating, including a "decriminalization of drug use."
The vote marked a departure from a proposal put forth by party leadership, which had suggested only allowing the use of milder illegal drugs, such as hashish.
Though most experts consider harder drugs like heroin and cocaine especially dangerous due to their addictive potential and effects on the brain, delegates opted not to distinguish between "hard" and "soft" drugs.
The Left's first comprehensive policy document has been four years in the making.
The party's endorsement was met with staunch criticism from the conservative camp. Stephan Mayer, a domestic policy spokesman for the Bavarian conservatives, the Christian Social Union, described it as "preposterous," calling it a "completely wrong signal for prevention efforts."
"With this, the Left party has again provided proof that it cannot and may not take on any governmental responsibility," Mayer said.