SACRAMENTO, Calif. — Pharmacists in California will be able to dispense HIV prevention pills to patients without a doctor's prescription after Gov. Gavin Newsom signed legislation Monday that supporters say will greatly reduce the spread of infection.

Advocates of Senate Bill 159 say California is the first state to authorize pre-exposure prophylaxis, also called PrEP, and post-exposure prophylaxis, known as PEP, without prescriptions. California is already considered a leader in AIDS prevention, they say.

PrEP is a once-daily pill for HIV-negative people while PEP is a medication that people take to prevent the virus from taking hold. Supporters say PEP significantly reduces the risk of infection, but only if started within 72 hours of exposure to the virus.

Not everyone can get to a doctor in that time frame, says Rick Zbur, executive director of Equality California.

"The ability to go into a pharmacy to avail themselves of the medication is a huge improvement to removing a barrier," he said.

He says the law will greatly improve access and help reduce the stigma around the drugs, especially in rural areas and among minorities.

Nearly 30,000 people in California use PrEP and 6,000 use PEP, according to the California Health Benefits Review Program, which provides analysis to the Legislature.

The California Medical Association was initially opposed to the legislation but became neutral on it after it was amended to limit the number of PrEP pills patients can get without a physician's note to 60 days, said Anthony York, spokesman for the association.

The association was concerned about "long-term use without physician oversight," he said.

The law also prohibits insurance companies from requiring patients to get prior authorization before using insurance to get the drugs, eliminating another obstacle.

The bill was co-authored by state Sen. Scott Wiener, D-San Francisco, who has publicly disclosed that he takes PrEP as an HIV prevention strategy.

"To end new HIV infections, we must dramatically expand access to PrEP and PEP, yet far too many Californians who need these drugs struggle to access them," he said.

Pharmacists in California are already authorized to dispense emergency contraceptives and birth control without a prescription.

Newsom also signed legislation Monday aimed at lowering the cost of prescription drugs. The new law targets so-called "pay for delay" agreements, when makers of brand-name drugs pay for makers of similar generic drugs to delay putting the products on the market.

The new law presumes such arrangements are anti-competitive and steps up enforcement to stop them.

Drug companies argue the bill will cause more delays for generic drugs by ensuring lengthy legal battles over patents.

Follow NBC Out on Twitter, Facebook & Instagram