Updated

California lawmakers approved emergency legislation Friday to allow a man with HIV to receive part of his HIV-positive husband's liver before the surgery becomes too dangerous, possibly within weeks.

Democratic Gov. Jerry Brown promptly signed the bill, which takes effect immediately.

The federal government recently authorized transplants of HIV-infected organs to patients who have the disease, but it remained illegal under California law and in more than a dozen other states, a leftover fear from the AIDS epidemic in the 1980s and 1990s.

But advances in testing have since diminished concerns about donated tissue, and antiretroviral medications now allow patients to live for decades with HIV. The California legislation paves the way for any HIV-positive transplant patient to receive organs from living or deceased people with HIV. For patients willing to receive an HIV-infected organ, the wait time could be cut from many years to six months or less.

The University of California, San Francisco Medical Center is one of four U.S. hospitals authorized to transplant HIV-infected organs. Transplant surgeon Dr. Peter Stock said he hopes to quickly perform the operation on the man and his husband, whose names were not disclosed, but he will need time to do tests and preparation.

There are 65 HIV-positive patients waiting for kidney or liver transplants at the hospital, including another man in particularly urgent need of a liver. That man does not have a living donor.

California has some of the nation's longest waits for organs, and increasing the supply will help everyone, whether they are HIV-positive or not, Stock said.

"There are so many desperate people out there waiting for organs," the surgeon said. "The donor shortage is such a problem. Literally, we lose people every week."

Stock received a grant in 1999 to transplant healthy livers and kidneys into patients with HIV. Hundreds of HIV patients have now received transplants for HIV-negative donors, with largely similar rates of success to transplants for non-HIV people, allaying concerns about using immunosuppressant drugs to prevent organ rejection in patients with compromised immune systems, he said.

President Barack Obama signed legislation in 2013 to allow trials of HIV-infected transplants, and the Department of Health and Human Services approved safety regulations last year.

Doctors at Johns Hopkins University Medical Center in March performed the first transplant in the United States of HIV-infected organs using a liver and kidney from a deceased donor. Similar operations had been conducted earlier in South Africa.

Just under 121,000 Americans are currently waiting for an organ transplant, including 21,888 in California, according to the United Network for Organ Sharing, which manages the U.S. organ transplant system. On average, 22 people die each day while waiting for a transplant.

"With this legislation, we're saving a life this month, and many more to come," said Sen. Ben Allen, a Democrat from Santa Monica who wrote the bill.

SB1408 cleared the Legislature without opposition.