The court backed complaints by a group of terminally ill patients and doctors who challenged the law that made "commercial promotion of assisted suicide" a criminal offence.
Assisted dying had been legal.
But the law change prompted terminally ill people to go to Switzerland and the Netherlands to end their lives.
Advice centres that operated until 2015 had to stop working because of the risk of a jail sentence for promoting suicide.
The law was aimed at stopping groups or individuals creating a form of business, by helping people to die in return for money. In practice it meant a ban on providing any type of "recurring" assistance.
Medical ethics expert Gita Neumann, who has provided advice and support for years to people in their 80s said she knew of no doctor in Germany who had helped with assisted suicide in the past five years, because of the new clause in the criminal code.
One of the plaintiffs, Dr Matthias Thöns, said that normal palliative work had become criminalised. However, the head of Germany's palliative medicine society, Heiner Melching, warned that overturning the ban could open a door to "self-styled euthanasia assistants".
What the court ruled
The head of Germany's constitutional court, Andreas Vosskuhle, said on Wednesday that while parliament could pass laws on preventing suicide and increasing palliative care, it was not entitled to affect the impunity of assisted suicide.
But there remains no legal entitlement to euthanasia and doctors cannot be required against their will to help provide assisted suicide.
When the law was changed in 2015, lawmakers sought to prevent assisted dying becoming socially acceptable. Euthanasia in Germany remains punishable by up to five years in jail.
The issues surrounding assisted dying and euthanasia are particularly sensitive in Germany because of the Nazi campaign of murder of 300,000 people with mental and physical disabilities. The Nazis referred to the murders as a "euthanasia programme".
What European countries say about assisted dying and euthanasia
The Netherlands, Belgium and Luxembourg permit euthanasia and assisted suicide in some, strictly regulated circumstances
Switzerland permits assisted suicide if the person assisting acts unselfishly
Portugal is currently considering plans to legalise euthanasia