Fraudsters created a sham breast cancer foundation that took in millions of dollars in donations — then pocketed over 90 percent of the funds, according to New York’s attorney general.

“There are few things more galling than pretending to help cancer patients, when you’re really just lining your own pockets,” said AG Eric Schneiderman.

Schneiderman extracted a $350,000 settlement from Dr. Yulius Poplyansky, president of the Breast Cancer Survivors Foundations or BCSF.

The AG’s investigation revealed that a longtime alleged charity scammer, Mark Gelvan, 49, of Boonton, NJ, was behind the scheme.

Gelvan — who’s been barred for life from fundraising in the state — and the doctor were family friends going back to the 1970s, according to the AG.

“Gelvan suggested that Dr. Poplyansky start a breast cancer charity because it is a proven charitable moneymaker,” the doctor admitted during the probe.

Then the Aventura, Florida-based internal medicine specialist “allowed Mark Gelvan to run BCSF and turn it into a cash cow for Gelvan and his businesses,” the AG found.

The foundation started in 2010. Four years later it was raking in $3 million annually from national telemarketing and direct mail campaigns. Gelvan helped himself to most of those donations, the AG said.

The staff lured donors with phony stories of doctor-patient interactions, nonexistent forums for breast cancer survivors, and bogus pharmaceutical programs, Poplyansky acknowledged in a statement.

“In reality, BCSF had no medical staff, performed no medical services, had no real office, and provided no direct value to breast cancer patients or those at risk of developing breast cancer,” the AG said.

“BCSF made only a few modest grants to clinics; those grants were, on average, only 3.5 percent of the funds it raised,” according to the AG.

Schneiderman hit Gelvan with a $50,000 fine in 2014 after he violated his fundraising ban. Ten years earlier Gelvan agreed to the ban after he was accused of lying to donors about a police charity.

A spokesman for the AG declined to say whether Schneiderman was pursuing criminal charges against Gelvan.

Gelvan and Poplyansky did not immediately return a call for comment.