The bill passed by a vote of 104-40. It still needs the approval of the Dutch Senate, which is considered a formality, and is expected to enter into force next year.
Advocates say the law puts the Dutch in the vanguard of patient rights, while opponents say it will replace caring with killing.
Euthanasia won legitimacy, if not legality, in 1993, when parliament approved guidelines under which it was understood doctors would not be prosecuted, even though it remained a crime punishable by a maximum 12-year prison sentence.
Under those guidelines, a patient must be undergoing irremediable and unbearable suffering, be aware of all other medical options and have sought a second professional opinion. The request must be made voluntarily, persistently and independently while the patient is of sound mind. Doctors are not supposed to suggest it as an option.
The new law also allows patients to leave a written request for euthanasia, giving doctors the right to use their own discretion when patients become too physically or mentally ill to decide for themselves.
No other country has attempted to legalize euthanasia, health officials and legal experts said, though it is tolerated in Switzerland, Colombia and Belgium.
Euthanasia is illegal in the United States, except in Oregon, where voters approved doctor-assisted suicide for the terminally ill in 1994. Since the law took effect in 1997, 43 people have died in Oregon in assisted suicides.
The head of the Dutch Labor Party, the largest party in the governing coalition, hailed the new legislation.
"It will give freedom of choice at the most emotional moment of one's life," said the party leader Ad Melkert.
Rita Marker, executive director of the International Anti-Euthanasia Task Force, said the law will send a dangerous signal "telling people that if it's legal, it's right."
"It will be like giving the household seal of approval. What is currently a crime will be transformed into medical treatment," Marker told The Associated Press.
Doctors honor about a one-third of assisted suicide requests in the Netherlands each year, according to government estimates. In 1999, 2,216 cases were recorded, but there also were believed to be a larger number of unregistered cases.