Updated at 6: 15 p.m. Revised to include Senate vote and White House reaction.

Environmental advocates have netted congressional support for protections against a border wall they say would destroy a popular Texas butterfly habitat.

The deal won't be done until President Donald Trump signs it — and the National Butterfly Center fears the fight won't be over even then — but U.S. Rep. Henry Cuellar, D-Laredo, said the bipartisan border security agreement includes protections for the butterfly refuge and other wildlife areas along the southern Texas border. The Senate and House both approved the deal Thursday, and Trump was expected to sign the legislation Friday.

The butterfly center has publicly battled the Trump administration for about a year over the planned barrier through its property. Congress had already approved funding for the wall through the center last March.

A red-bordered pixie butterfly at the National Butterfly Center in Mission, Texas. (Suzanne Cordeiro / Agence France-Presse)

Cuellar — a member of the conference committee that produced the bill that's meant to avert another government shutdown — issued a statement Thursday saying the deal represented “a big win for the Rio Grande Valley.”

As the only lawmaker on the bipartisan committee who represents the southern border region, Cuellar said, he fought to preserve the parklands "because protecting these ecologically sensitive areas and ensuring local communities have a say in determining the solutions that work for them is critical."

He said the government "can secure the border in a much more effective way, and at a fraction of the cost, by utilizing advanced technology and increasing the agents and properly equipping them on the border."

The White House said Thursday that President Trump would sign the bill, even as he planned to declare a national emergency and bypass Congress to build his wall.

White House Press Secretary Sarah Huckabee Sanders said in a statement that Trump would sign the bill and take "other executive action, including a national emergency."

"The president is once again delivering on his promise to build the wall, protect the border, and secure our great country," the statement said.

Senate Majority Leader Mitch McConnell, R-Ky., told the Senate about the president's plans shortly before the measure passed, 82-16. The House followed with a 300-128 vote for the measure, which would avoid a government shutdown otherwise set to begin Saturday.

The entrance to the National Butterfly Center in Mission, Texas. (Suzanne Cordeiro / Tribune News Service)

The Trump administration's stance prompted the butterfly center's executive director, Marianna Treviño-Wright, to call the congressional measure merely "a stay of execution." She said she feared the butterfly center was "not out of the woods."

Treviño-Wright said the emergency action and the start of a new federal fiscal year on Oct. 1 could put the butterfly center back in the fight against new efforts to build a wall through its property.

"We'll be back at the budget battle in six months," she said.

U.S. Rep. Henry Cuellar, D-Laredo, in a photograph provided by his office Oct. 24, 2018. (Eric Connolly U.S. House Office of Photography)

The butterfly center has tried for more than a year to stop the part of the border barrier that Congress approved last March. But the debate over the Trump administration's demands for billions more dollars in border-wall funding focused national attention on the preserve's plight.

Recently, the center filed for a restraining order against U.S. Customs and Border Protection, which it said had already begun to move construction equipment through the preserve and on adjacent property. The agency’s spokesman, Carlos Diaz, declined to comment, citing pending litigation.

The feds had said publicly that they intended to start building the wall through the butterfly center this month.

Several groups, including the butterfly center, had filed lawsuits to challenge the Trump administration's decision to speed construction by waiving of dozens of environmental, health and safety laws. The Texas waivers allowed walls to cut through not only the butterfly center but also the Lower Rio Grande Valley National Wildlife Refuge, Bentsen-Rio Grande State Park and other private property.

The cases are still pending.

Information from the Associated Press was used in this report.