A Border Patrol agent in Arizona has pleaded guilty to accidentally starting a massive wildfire last year while off duty at his wife’s gender-reveal party.

Dennis Dickey, 37, of Tucson, admitted Friday to igniting the Sawmill Fire, which burned more than 45,000 acres and caused $8 million worth of damage in April 2017, according to a press release from the Arizona U.S. Attorney’s Office.

RESEARCHERS RECOMMEND 'NO-SELFIE ZONES' TO PREVENT TOURIST ACCIDENTS

As part of the gender reveal, Dickey shot a rifle at a target containing Tannerite, a highly explosive substance, which was meant to explode with colored powder upon impact.

“It was a complete accident,” Dickey told a judge Friday, according to The New York Post. “I feel absolutely horrible about it. It was probably one of the worst days of my life.”

Unusually high winds of around 40 mph and lower than average rainfall contributed to the fire’s growth, which took about a week to contain, The Washington Post reported.

Dickey, who immediately called the fire department and admitted to starting the fire was charged with a misdemeanor for violating U.S. Forest Service regulations.

He has been sentenced to five years’ probation, and will be making a public service announcement with the U.S. Forest Service concerning the cause of the fire. The Arizona U.S. Attorney's Office reports that he also agreed to pay $8,188,069 in restitution, although his attorney announced that the state is not making him pay the full amount, but rather only $220,000, as it would be like "getting blood from a stone," according to KETK.

FOLLOW US ON FACEBOOK FOR MORE FOX LIFESTYLE NEWS

People on Twitter couldn’t help but make fun of this disastrous outcome.

"'Gender reveal' parties are literally ruining the earth," one person wrote.

"Only You Can Prevent Gender Reveal Parties," someone commented.

"Is it a boy or a girl? No. It is a fire. Congratulations," another person tweeted.

"Ok, now can we please just stop with the gender reveal parties?" someone else wrote.

This isn’t the first time a gender reveal party has gone wrong. A grandfather-to-be was smacked in the face with a ball full of blue powder after the batter struck out at a baseball-themed gender reveal in California.