An off-duty border patrol agent wanted an explosive gender reveal party for his family and friends, but he ended up igniting a wildfire that spread to Coronado National Forest in Arizona.

Dennis Dickey, 37, of Tucson, Arizona, has to pay more than $8 million in restitution, starting with a $100,000 initial payment and monthly payments thereafter, the Department of Justice said in a statement.

Dickey pleaded guilty Friday to a misdemeanor violation of US Forest Service regulations for igniting the Sawmill Fire, the statement said. He agreed to a sentence of five years of probation and will make a public service announcement with the Forest Service about the cause of the blaze.

His gender reveal party was on April 23, 2017, according to CNN affiliate KGUN-TV. Expectant parents throw such parties to tell family and friends the gender of their baby. In this case, Dickey’s plan was to shoot a rifle at a target containing Tannerite, a highly explosive substance that would have exploded to reveal either blue powder for a boy or pink powder for a girl.

Dickey shot the target, causing it to explode and start a fire that spread and resulted in what was known as the Sawmill Fire, the Department of Justice said.

The Sawmill Fire burned nearly 47,000 acres owned by the state of Arizona and various federal agencies. The Coronado National Forest is federal land operated by the US Forest Service.

Firefighters from at least 20 agencies fought the fire for about a week, the affiliate reported.

Dickey immediately reported the fire and admitted to starting it, the Department of Justice said.

CNN has reached out to Dickey’s attorney, but has not heard back. Dickey has not revealed the gender of his baby, KGUN reported.