A 20-year-old Minnesota woman whose quest for internet fame took a tragic turn when she fatally shot her boyfriend during a stunt apparently intended for YouTube has pleaded guilty to second-degree manslaughter.

In June, the woman, Monalisa Perez of Halstad, Minn., shot at a thick book that her boyfriend, Pedro Ruiz III, was holding, apparently believing that the bullet would not make it through the volume.

But the bullet went through the book and entered Mr. Ruiz’s chest, fatally wounding the 22-year-old man. Over the next several days, Ms. Perez and the YouTube videos she had previously posted with her boyfriend garnered much attention — but not for the reasons she had hoped.

On Friday, Ms. Perez entered her guilty plea, according to court records. Local media reports said that a plea agreement called for Ms. Perez to serve 180 days in jail and spend 10 years on supervised probation, though The Pioneer Press said a judge would have the final say on her sentence.