HIV testing will soon become part of routine prenatal care and be required for some newborns in New Jersey under a new law that supporters say is putting the state in the forefront of the national fight against HIV transmission to babies.

Acting Gov. Richard J. Codey signed the measure into law Wednesday at University Hospital in Newark. The law will take effect in six months.

"We can significantly reduce the number of infections to newborns and help break down the stigma associated with the disease," Codey said. "For newborns, early detection can be the ultimate lifesaving measure."

Codey, the acting governor while Gov. Jon S. Corzine is out of the country this week for the holidays, sponsored the bill as the Senate president.

The bill allows women to opt out of the HIV testing, but critics contend the screening will deprive women of their right to make medical decisions.

According to the Kaiser Foundation, a nonprofit research organization focusing on U.S. health care, New Jersey is the first state to push HIV testing for both pregnant women and newborns.

Arkansas, Michigan, Tennessee and Texas require health care providers to test a mother for HIV, unless the mother asks not to be tested, while Connecticut, Illinois and New York test all newborns for HIV, according to the foundation.

New Jersey has required providers only to offer HIV testing to pregnant women. Under the new law, HIV testing will be part of routine prenatal care for all pregnant women, and doctors will provide pregnant woman with information about HIV and AIDS. It also requires newborns to be tested when the mother has tested positive or her HIV status is unknown.

Riki E. Jacobs, executive director of the Hyacinth AIDS Foundation in New Brunswick, the state's largest AIDS service agency, said the law won't help the women who don't get prenatal care.

"We need to focus on getting people into care and keeping them in care," Jacobs said. "That is our most potent prevention weapon."

The federal Centers for Disease Control and Prevention has recommended all pregnant women be tested for HIV, though it has said testing should be voluntary. The CDC also found medical intervention during pregnancy can cut mother-to-child HIV transmission from 25 percent to 2 percent.

New Jersey has about 17,600 AIDS cases, according to the Kaiser Foundation. Women represent 32.4 percent of the cases — the third highest rate in the nation. The national average is 23.4 percent.

The state has about 115,000 births per year and had seven infants born with HIV in 2005, according to state health department officials.

The American Civil Liberties Union and some women's groups contend the bill deprives women of authority to make medical decisions.

"Women's privacy rights and choices are as constitutionally valid as any other citizen, regardless of reproductive status," said Maretta J. Short, New Jersey's National Organization of Women president.