The cause? A gender-reveal party gone horribly wrong.

Dennis Dickey, an off-duty Border Patrol agent, was celebrating his wife’s pregnancy at a party near Green Valley, Ariz., on April 23, 2017, his attorney told the Arizona Daily Star on Friday. In preparation, he had filled a target with colored powder. When it exploded, it would reveal their future child’s sex: pink for a girl or blue for a boy.

The target also contained Tannerite, a legal but highly explosive substance, U.S. Forest Service special agent Brent Robinson wrote in an affidavit filed in federal court on Sept. 20. When Dickey, now 37, fired his rifle at the target, the ensuing explosion sparked a fire that quickly spread through the dry brush, spurred on by unusually high winds and lower-than-average rainfall. By the time it was fully contained over a week later, the fire had done $8 million worth of damage.

Dickey immediately reported the fire to law enforcement and admitted he had been responsible for starting it, the affidavit says. He was charged with violating U.S. Forest Service regulations by causing a fire without a permit, a misdemeanor offense. On Friday, the U.S. attorney’s office in Arizona announced that Dickey had pleaded guilty.

Dickey and his attorney, Sean Chapman, couldn’t be reached late Sunday night to confirm whether the baby was a boy or a girl.

When gender-reveal videos began appearing on YouTube roughly a decade ago, they featured couples taking part in fairly low-impact activities: popping balloons to release pink or blue confetti or cutting into cakes filled with pink or blue icing. The trend has been criticized for reinforcing gender stereotypes and ignoring the fact that some children’s gender identities don’t match their biological sex. Still, the videos’ popularity has only grown: In 2017, the number of American viewers watching gender-reveal videos was 60 percent above the previous year, Stephanie Shih, a spokeswoman for YouTube, told The Washington Post in May.

Watch more!

Meanwhile, expectant parents have been coming up with increasingly creative (some might say outlandish) ways to announce whether they’re having a boy or a girl. This summer, a Louisiana man brought out a live alligator at his wife’s gender-reveal party and placed a watermelon in its mouth. When the large reptile snapped its jaws, the watermelon exploded, spilling blue Jell-O onto the grass. Although no one was harmed, the Louisiana Department of Wildlife and Fisheries later warned people not to try the same trick at home.

While the incident in Arizona may be the first time a gender-reveal party has ended in a wildfire and caused $8 million in damage, it isn’t the only occasion when the much-hyped reveal has taken a strange, even disastrous turn. Prior mishaps include a California grandfather-to-be getting smacked in the face with a powder-filled baseball and ending up with blue hair, an expectant New Jersey father breaking his ankle while kicking a football that spewed out pink paint, and a Philadelphia-area couple accidentally shooting pink fireworks into a crowd and sending their family and friends screaming and running for cover.

During a court appearance on Friday, Dickey told the judge the fire “was a complete accident,” the Daily Star reported. He added: “I feel absolutely horrible about it. It was probably one of the worst days of my life.”

As part of his plea agreement, Dickey will star in a public service announcement created in partnership with the U.S. Forest Service. He will spend five years on probation and has agreed to pay restitution totaling $8,188,069, the U.S. attorney’s office said in a news release.

Whether he’ll actually pay the whole $8 million is another story. The news release from the U.S. attorney’s office says Dickey will make an initial payment of $100,000, then make monthly payments after that. According to the Arizona Daily Star and the Green Valley News, Dickey agreed in court to pay $500 a month for the next 20 years, which adds up to $120,000.

There were no discussions in court on Friday about what will happen after 20 years, the Green Valley News reported. Dickey’s attorney told the paper that his client’s payments will increase if his income increases.

The Border Patrol has not commented on the incident but told Nogales International in June that Dickey was still employed by the agency.