A deal is nearing aimed at expanding the state’s preference in purchasing of American-made goods, top state lawmakers said after emerging from a closed-door meeting in Gov. Andrew Cuomo’s office on Monday late afternoon.

“We’re happy that we’re coming to an agreement on a Buy American bill, a three-way bill, that’s something very important to myself and Senator Flanagan’s conference,” said Sen. Jeff Klein, the leader of the Independent Democratic Conference. “We’re close to a three-way agreement.”

The proposal was initially made at the start of the year by Cuomo, who had wanted to require state entities buy American-made products for any procurement larger than $100,000. The state’s procurement laws would also be amended to for all procured goods and products, not just steel.

No agreement on the buy American provision was reached in the state budget talks.

At the same time, Klein said, lawmakers are working on a package of measures aimed at curtailing heroin and opioid abuse.

An agreement would come in the final days of the legislative session as lawmakers are scheduled to depart the Capitol on Wednesday.

Still left undone is an extension of mayoral control of New York City schools, which Senate Republicans are linking to an expansion of charter schools — an approach Cuomo has spoken favorably of in recent days.

“I still think we have time to reach an agreement,” Republican Senate Majority Leader John Flanagan said of the issue, “and yes we’re leaving Wednesday.”