A white man who fired a shotgun at a black teenage boy who had knocked on his door to ask for directions was sentenced on Tuesday to prison.

The man, Jeffrey Zeigler, 53, of Rochester Hills, Mich., was sentenced to two to 10 years in prison for assault with the intent to commit great bodily harm, and an additional two years for using a firearm during a felony.

The sentences will be served consecutively, which means he will serve at least four years before he is eligible for parole.

“I am full of remorse and regret,” Mr. Zeigler, a retired firefighter, said in court on Tuesday. “I wish I could change something.”