The governor of Arkansas has signed a law that requires doctors to investigate the pregnancy history of women seeking abortions and to make sure they are not using the procedure as a way to select the gender of the child. Abortion rights proponents said on Thursday that they planned to challenge the law.

The law, signed by Gov. Asa Hutchinson on Wednesday, banning “sex-selection abortion” requires doctors to ask a woman seeking an abortion if she knows the gender of the fetus she is carrying, and if she does, to tell her it is illegal to choose an abortion based on that information. The doctor is also required to obtain the medical records that pertain to her pregnancy history.

Doctors who do not comply face misdemeanor charges, with up to a year in prison and a fine of up to a $2,500 as well as civil penalties, The Associated Press reported. It would also lead to revocation or suspension of the doctor’s medical license.

Opponents of the newest law, which takes effect on Jan. 1, 2018, said it was an invasion of medical privacy. Mr. Hutchinson, a Republican, had no comment on Thursday, his office said in an email.