ISLAMABAD, Pakistan — A Pakistani newlywed has been arrested and charged with murder in the poisoning of 17 people, including several of her in-laws, in what officials described as an attempt to escape from a forced marriage.

The woman, Aasia Bibi, 21, and a man identified as her boyfriend were accused of having intentionally put rat poison into milk that was served to family members at a gathering.

Ms. Bibi, who appeared in a court in Punjab Province, told reporters she had begged her parents not to force her to marry, but her pleas were ignored. She has been charged under the country’s antiterrorism law and was placed in pretrial detention.

After consuming the tainted milk two weeks ago, 27 members of the extended families were hospitalized. Seventeen of them, including a 4-year-old, a 7-year-old and Ms. Bibi’s husband, Muhammad Amjad, 23, died, officials said.