Image copyright AP Image caption The case of Brittany Maynard (shown in a picture held by her mother) helped draw support for the law

California has joined four other US states that allow terminally ill patients to legally end their lives with a doctor's supervision.

State Governor Jerry Brown signed the bill into law on Monday.

The bill was partly inspired by the case of a terminally ill California woman who moved to Oregon to end her life.

At least two dozen states introduced aid-in-dying legislation this year, but none has become law.

The right-to-die movement gained support in California after Brittany Maynard, a cancer patient who lived in the state, moved to Oregon to legally end her life.

Her family including her mother, Debbie Ziegler, spoke in support of the bill.

Religious groups had opposed the bill, saying assisted suicide was against God's will. The Catholic Church had urged Governor Brown to veto it.

Advocates for people with disabilities also worried that terminally ill patients could be pressured into choosing death.

'Would be a comfort'

Governor Brown, a Catholic who once studied to become a priest, had taken weeks to decide whether to sign the bill.

"In the end, I was left to reflect on what I would want in face of my own death," Governor Brown said.

Media playback is unsupported on your device Media caption California has become the fifth American state to allow terminally ill patients to end their lives legally

"I do not know what I would do if I were dying in prolonged and excruciating pain. I am certain, however, that it would be a comfort to be able to consider the option afforded by this bill."

The law stipulates that two doctors must approve the use of the life-ending drugs and two witnesses must be present when the drugs are administered.

The patient also must be physically capable of taking the drugs themselves.

Oregon, Washington, Vermont and Montana already have similar laws in place.