For years, New York law permitted developers to built atop Native American burial sites without taking steps to preserve the ancient remains, making the state one of only four with no meaningful protection for graves on private lands.

But that is set to change thanks to a provision included in the state budget deal Gov. Kathy Hochul announced last week. The measure, which passed the Assembly and Senate Monday night, would for the first time require private landowners to halt development if they discover a burial site on their property, and make it a crime to remove, deface or sell the remains or funerary objects.

The new law now heads to the governor, and she is expected to sign it this week.

“This is a major victory for Native Americans across the state of New York,” said Assemblyman Fred Thiele, a Long Island Democrat and author of the bill. “It’s something that should have been done decades ago.”

Representatives of the state’s tribes had pushed legislators to protect the graves of their ancestors for almost 20 years, only to see bills die without getting to a vote. And when a grave protection bill finally passed last year with unanimous approval, Ms. Hochul vetoed it, saying it stripped landowners of their property rights.

The veto drew harsh criticism from tribal leaders and their backers, who blamed powerful business and real estate interests for the repeated failures to pass the legislation.

“The fact that special interests had been able to block it for so long I think is regrettable,” Mr. Thiele said.

After the veto last year, Ms. Hochul said she would seek to balance grave protection with property rights.

“Governor Hochul is pleased to have worked with the legislature to reach an agreement that establishes a clear, respectful process,” said Ms. Hochul’s spokeswoman, Hazel Crampton-Hays.

Protections in New York already exist for unmarked graves found on public land, or during excavation for publicly-funded projects.

Under the measure being considered, landowners would have to call the county medical examiner or coroner if human remains are discovered on their property. If the authorities find the remains are of ancient Native American origin, a burial site committee of tribal representatives and state experts would examine the case and decide, together with the landowner and descendants of the dead, what to do next.

Differences over what should happen when the landowner and the descendants disagree, including the prospect of delays, led to Ms. Hochul’s veto. Hashing out the details consumed months of negotiation.

But the language in the budget proposal offered a solution: tribal descendants and “culturally affiliated groups” — other tribes having some connection to the remains — would be given the “right of possession” of the Native American remains and burial objects. But landowners would have the right to have the remains removed by professional archaeologists, at the landowner’s expense, if no agreement can be reached.

A tribal representative would be allowed to monitor excavations, and the whole process would usually be finished within three months.

Chief Harry Wallace, leader of the Unkechaug Nation of Long Island and chief negotiator for the tribes, insisted on a provision barring property owners from touching native remains or artifacts. Under current law they own burial sites discovered on their land.

Mr. Wallace said the safeguards were needed to ensure property owners or developers do not plunder or disrespect Native American burial sites. He noted that museums worldwide contain artifacts looted from Native American graves.

A state lawmaker who filed grave protection bills dating to 2005 — former Assemblyman Steve Englebright, a Democrat of Long Island — said he would be pleased to see the measure become law.

“I thought we would catch up with our sister states at some point,” Mr. Englebright said. “I didn’t think it would take almost 20 years.”