Image copyright Police handout Image caption Perez was pregnant with the couple's second child at the time of the shooting

A YouTube prankster from the US state of Minnesota has admitted fatally shooting her boyfriend in a videotaped stunt they hoped would go viral.

Monalisa Perez, 20, told investigators she fired a gun from about a foot away at a book held by Pedro Ruiz III, on 26 June.

She said they expected the bullet to embed harmlessly in the volume. Ruiz, 22, died from a gunshot to the chest.

Perez pleaded guilty to second-degree manslaughter on Friday.

Her plea deal entails her serving six months in prison and 10 years of supervised probation.

What are four of the biggest hazards of social media?

Perez is also reportedly to be banned for life from owning firearms.

The couple posted videos of their pranks to a YouTube channel in a quest for internet fame, according to court records.

Image copyright Youtube Image caption The couple posted videos of their pranks to YouTube in a quest for internet fame

Previous stunts had included Ruiz falling out of a tree, or jumping into a swimming pool from the top of a house, or Perez feeding him a doughnut covered in baby powder instead of sugar.

In a tweet sent hours before the fatal gun clip, Perez tweeted to their followers that she and Ruiz were going to "shoot one of the most dangerous videos ever".

Perez later told investigators Ruiz had convinced her to participate by showing her other books he had shot where the bullet did not go through to the other side.

They used a GoPro camera to film as Ruiz held a 1.5in (4cm) thick hardcover encyclopaedia to his chest.

Skip Twitter post by @MonalisaPerez5 Me and Pedro are probably going to shoot one of the most dangerous videos ever😳😳 HIS idea not MINE🙈 — Monalisa Perez (@MonalisaPerez5) June 26, 2017 Report

Perez aimed a Desert Eagle .50 calibre handgun at the book and pulled the trigger.

The couple's three-year-old child and nearly 30 onlookers were watching.

Perez called 911 to report she had accidentally shot her boyfriend.

Ruiz was pronounced dead at the scene at their home in Halstad.

Perez was pregnant with their second child at the time of the shooting.

Perez will be sentenced in February.