Following an impassioned four-hour debate in the House of Commons, the Terminally Ill Adults (End of Life) Bill was rejected by 286 votes to 270.
The outcome was something of a surprise given that an almost identical bill had passed last year with a margin of 23 votes.
Australian-born Labour MP Lauren Edwards, who reintroduced the bill, said the rejection was "heartbreaking" but expressed hope the issue will win parliamentary approval in the future.
"Assisted dying will come in this country, as it is already doing all across the world, but not soon enough," she said.
"Parliament has dropped the ball today. It will be picked up again as it must be, because the law as it stands is simply too cruel and too unjust to be allowed to stand."
The vote brings to an end a two-year debate in parliament about assisted dying, during which the House of Commons had backed the bill on two previous occasions.
That support, though, was not enough for it to become law because it was effectively filibustered in the unelected House of Lords.
Back in the House of Commons on Friday, the bill had proposed allowing adults in England and Wales with fewer than six months to live to apply for an assisted death subject to the approval of two doctors and an expert panel.
The government took a neutral stance, meaning MPs voted according to their conscience rather than along party lines.
One politician who was among those to oppose the bill, having previously backed it, spoke about how "nightmares" prompted her to switch sides.
Labour MP Janet Daby said she dreamed of "dying and death" because she had not been "entirely comfortable" with her former position.
The new UK Prime Minister Andy Burnham did not vote, saying he did not want to "unduly influence the debate".
Opponents branded the bill unsafe and unworkable, citing concerns around potential coercion of vulnerable people and a lack of safeguards for those with disabilities.
Politician and cancer surgeon Dr Zubir Ahmed also noted uncertainty around a doctor's prognosis.
"When I am asked to prognosticate as to whether someone has six months to live or not, I am as often wrong as I am right," he said.
Opposition to the bill had been voiced by the leader of Catholics in England and Wales, Archbishop Richard Moth, who called it "wrong in principle" and "deeply flawed", as well as the Church of England's Archbishop of Canterbury, Sarah Mullally.
Medical colleges, including the Royal College of Psychiatrists, had also raised "serious concerns" about the bill, saying there were "too many unanswered questions about the safeguarding of people with mental illness".
Proponents of assisted dying had hoped it would mark the biggest change to social policy in the UK since abortion was partially legalised in 1967.
The intention was to put an end to the practice of those near the end of their lives going to other countries, such as Switzerland, for an assisted death.
Assisted dying is legal in countries including Australia, Belgium, Canada, Luxembourg, the Netherlands, New Zealand, Portugal, Spain, Switzerland and parts of the US, with regulations on qualifying criteria varying by jurisdiction.
Lifeline 13 11 14
beyondblue 1300 22 4636