(CNN) 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.

Read More