California will become the fifth state to allow terminally ill patients to legally end their lives under a new law signed by Gov. Jerry Brown (D).

Brown announced Monday that he had signed the bill, offering a personal reflection on how he came to the decision. Brown, a former Jesuit seminarian and lifelong Catholic, alluded to his personal struggle with the issue, noting that he consulted former classmates, two of his own doctors and a Catholic bishop in debating whether to sign the bill.

“I do not know what I would do if I were dying in prolonged and excruciating pain,” Brown wrote in a signing statement. “I am certain, however, that it would be a comfort to be able to consider the options afforded by this bill. And I wouldn’t deny that right to others.”

California joins four other states — Oregon, Washington, Vermont and Montana — in allowing such assisted suicides, making the practice legal for nearly 1 in 6 Americans.

California’s law is modeled off Oregon’s assisted suicide system, which was first approved by voters in 1994. Before receiving life-ending drugs, patients need two physicians to say that they have less than six months to live and are mentally fit to make the decision. Brown’s office could not immediately say when the new law would take effect.

California lawmakers introduced a right-to-die bill earlier this year for the first time since 2007. The lawmakers cited increased attention to end-of-life issues after the highly publicized case of Brittany Maynard, a 29-year-old San Francisco Bay Area woman with terminal brain cancer who moved to Oregon to legally kill herself in 2014.

What followed was the most emotionally intense legislative battle of the year in California. Patients with months to live, priests and people with disabilities were among those calling lawmakers’ offices and making emotional pleas in the state Capitol. Lawmakers shared stories of watching their parents’ succumbing to cancer to explain why they supported or opposed the bill.

The national right-to-die advocacy group Compassion and Choices focused lobbying efforts on California, seeing it as the best opportunity to expand the thin ranks of states where terminally ill patients could take life-ending drugs. Brown, who had brushes with cancer, did not take a public position on the legislation and left advocates of both sides guessing what he would do.

Brown, through a spokeswoman, objected to lawmakers pushing right-to-die legislation through a special session on health-care financing he convened, calling into question whether he would veto the bill. But proponents eventually prevailed when state lawmakers gave their final sign-off Sept. 11. Days after the bill was passed last month, the California Catholic Conference issued a statement calling on Brown to veto it

“Pope Francis invites all of us to create our good society by seeing through the eyes of those who are on the margins, those in need economically, physically, psychologically and socially,” the group’s executive director, Edward Dolejsi, wrote at the time. “Looking through those eyes, ABx2 15 is bad law for California. We ask the governor to veto this bill.”

This post has been updated.