The battle to fight off one species and foster another is playing out at the William Floyd Estate in Mastic Beach.

The two at odds?

Southern pine beetles that first showed up at the shoreline national park site in 2014 — attacking hundreds of trees and threatening the fragile ecosystem — and a pair of bald eagles.

The female, believed at the time to be too young to mate, was part of the duo that courted, nested and reared young in 2015 for the first time at the 600-acre estate in more than eight decades.

The situation presents a unique conservation challenge: a common method to stamp out the beetle infestation is to cut down trees. But eagles, who prefer isolated areas with big trees near wide-open spaces with water nearby, are easily disrupted by human activity.

“This is one of the obstacles that you need to deal with in terms of managing a forest,” said Jordan Raphael, a biologist with the Fire Island National Seashore, which oversees the William Floyd Estate. “We don’t want to be felling trees in close proximity.”

The beetles, who use pheromones to coordinate attacks en masse, first appeared in New York in 2014, showing up at William Floyd, Wertheim National Wildlife Refuge in Shirley, Connetquot River State Park Preserve in Shirley and elsewhere in Suffolk County, as well as in Orange, Rockland, Sullivan and Ulster counties.

advertisement | advertise on newsday

The eagles appeared at the end of 2014, then courted and took over an osprey nest in a black oak tree in early 2015, said William Floyd Park Ranger MaryLaura Lamont.

“That made history,” she said, explaining how they court. “Bald eagles lock talons, and spiral down. It’s an aerial ballet.”

There are signs of success and setback.

Last year, the eagles returned and fledged three eaglets.

Both species have continued to call William Floyd home to varying extents and their stories intertwine at times.

At William Floyd, about 700 trees were infected. Adding the barrier island, more than 1,500 trees were hit.

Now, Raphael said the number is about 20, thanks to an intense yearslong program of inspecting, marking, cutting down and removing trees. Much of the work happened in winter, when cutting the trees exposes dormant larvae to the elements.

But they had to avoid bothering the eagles, who nest from early January through the summer months.

Eagles were removed from the Endangered Species Act in 2007, but are still protected under the 1940 Bald and Golden Eagle Protection Act, which prohibits harassment of any kind that could interfere with an eagle’s nesting, mating and reproductive activities.

When pine beetle suppression work happened at William Floyd, the trees were knocked down outside of the eagles’ nesting season. And the standard buffer of 660 feet surrounding a nest was increased to 1,000 feet, Raphael said.

advertisement | advertise on newsday

The tree holding the eagle’s nest was not infected and only a handful nearby were showing signs of the invasive species attacking, he said.

But nature presented another challenge this year.

During an intense nor’easter in late January, the branch supporting the large nest gave way, and it fell to the ground. No eggs were in the nest, but this is the time of year they would be.

Park Service officials are watching the sky and asking the public to stay away from the old nesting area.

Lamont occasionally gets glimpses of the eagles, who typically have their eggs in late February to early March. “If they re-nest they have to make a nest quickly,” she said.

advertisement | advertise on newsday

That may be happening, according to Mari Michaelis, who was among the first in 2014 to photograph the nest and pair from Osprey Park, which is across Home Creek from William Floyd. “That first day, it was so exciting.”

She has seen them recently at Osprey Park.

“I saw them bringing sticks into the woods,” Michaelis said. “When I say sticks, it was like a branch. I knew they were doing something somewhere but it wasn’t visible.”

On Long Island, there are at least four known breeding pairs — at William Floyd, Wertheim and a preserve on Shelter Island, and on private property out east. That in and of itself is history, Lamont said.

Populations were dramatically reduced nationally because of habitat loss, hunting and the use of the insecticide DDT, which thinned eggshells and made them vulnerable. Forty years ago in New York, there was only one nesting pair, said Chris Lajewski, director of the Montezuma Audubon Center in Savannah in central New York.

Today there are 250 breeding pairs in the state and much of that can be traced to Montezuma, where 198 eagles were imported from other parts of the country between 1976 and 1989 to help resettle the population in New York.

The population growth has also created interest, and conservationists stress that people should keep their distance.

“This is a delicate balance,” Lajewski said. “We want people to be outside enjoying natural resources, but not to the point where they are disturbing the nests.”

As for the pine beetles, the Department of Environmental Conservation has cut down about 13,000 trees statewide in an effort to slow these invasives that are the size of a grain of rice. The results of ground surveys and aerial flights have been promising, said DEC forester Rob Cole, who is based in Albany.

“It’s not the huge expansion you see in an unmanaged area,” Cole said.

The agency has also awarded more than $513,000 in grants to Suffolk County and the towns of Brookhaven and Southampton for suppression work and tree removal.

“It appears that we are having an impact,” Cole said. “Small spots can fizzle out on their own and we are seeing that.”

The DEC has also collected pitch pine seeds to replant and created a demonstration forest in the pine barrens to show how to combat the invasive species.

Experts have told the state that the beetles, native to the southeastern United States, will never be fully eradicated but removing trees will help slow the attack.

Cutting trees and controlled fires can also help. Natural predators can swing the balance, too.

Clerid beetles, which prey on the southern pine, have been seen in small numbers locally. If that population increases, it will also help.

“Once it is here we’re not going to cut it all out,” Cole said. “What we can do is slow down the spread and reduce the population.”