A “misguided” environmental vigilante was arrested after chopping down hundreds of trees in a Long Island nature preserve over the past three months, authorities said.

The illegal lumberjack, a high-school math teacher, told authorities he did it all on his summer vacation with a hatchet and a small saw – to protect one kind of tree from another.

Alan Estergomy, 56, could already face four years in jail, and Suffolk District Attorney James Catterson said it’s likely the possible sentence will be increased.

“He thought he could save the forest by killing the trees,” said Catterson. “He had the misguided notion that pines cannot compete with other broad-leaf trees.”

Catterson said Estergomy, who teaches at Bellport HS, cut down at least 375 trees in the Prosser Pines Nature Preserve.

Once the environmental damage is added up, Catterson said, the charges “will be upgraded to more serious felonies.”

Citizens who witnessed the tree-chopping made note of Estergomy’s license plate and contacted authorities.

When detectives from Catterson’s office went to the preserve to investigate on Monday afternoon, Estergomy, of 24 Bailey Rd., Middle Island, was there walking his dog.

“He readily admitted it,” Catterson said. “He had the saw in the trunk of his car.”

Estergomy admitted to the detectives that he had actually been cutting down trees that morning, the DA said.

Estergomy allegedly told authorities he did it because he believed the trees would grow taller than the evergreens in the pine-barren area and eventually form a canopy above them – robbing them of sunlight and killing them.

His victims were sassafras, beech and other trees, ranging from saplings to trees with trunks more than 5 inches in diameter.

He was arrested and charged with third-degree criminal mischief, an E-felony. The damage to the preserve was initially estimated at several hundred thousand dollars. Estergomy declined to comment.

Catterson said the forest – offspring of pines planted by settlers in the early 1800s – has been doing just fine for generations, without any unauthorized help.