ALBANY — First responders will be barred from selling patient information for marketing purposes under legislation signed by Gov. Andrew Cuomo on Monday, ending a practice first exposed by The Post in 2014.

“Nothing is more personal than your health records, and New Yorkers have a right to privacy when it comes to this incredibly sensitive information,” Cuomo said. “This law sets clear guidelines so patient information isn’t sold or used for marketing purposes and most importantly doesn’t end up in the wrong hands.”

Previously, first responders could sell an individual’s personal information to third parties including addresses, phone numbers, prescriptions and medical history.

Now, only health care providers, the patient’s insurer and law enforcement can have access.

The changes take effect in 180 days.

“We live in a world where we have to be concerned with how our data is being bought and used every day,” said state Sen. John Liu (D-Queens), who introduced the legislation alongside Assemblyman Ed Braunstein (D-Queens).

Liu added: “Under no circumstances, when someone is in the middle of a life-threatening crisis, should they have to worry about their information being sold for any reason.”

Lawmakers passed the bill five years after The Post first exposed the FDNY’s murky patient privacy notice, which gave the department the right to use patient information — from home address to prescriptions — for fundraising, marketing and even had the right to sell it.

At the time, the FDNY’s privacy notice said the data could be used for “business-planning purposes, military/national defense and certain law-enforcement purposes.”

And, it added: “We may also use and disclose your PHI [personal health information] for certain marketing and fund-raising activities.”

Officials told The Post in 2014 they were unaware of the FDNY selling or licensing the data, but said the agency “reserves the right to do so.”

Braunstein and Liu cited The Post’s reporting when they introduced the bill.

“Patients have a right to privacy and their medical information should never be sold to pharmaceutical companies, insurers, nursing homes or other businesses,” Braunstein said.