As part of a probe into sleazy “pay-to-play” donations made by nonprofit groups, state Attorney General Andrew Cuomo has ordered dozens of charities to take back illegal contributions they’ve made to politicians — or lose their tax-exempt status, The Post has learned.

Cuomo has begun notifying individual charities by letter that he’s on to their wrongdoing. His office has uncovered improper campaign donations to state and city lawmakers that have been made by dozens of nonprofits, despite laws that bar them from such political activity.

“The issue of charities or not-for-profits giving political contributions is a matter we are currently investigating. It is not appropriate, and it is not legal, and we want to make sure it doesn’t happen anymore,” a spokesman for Cuomo told The Post.

The spokesman said the continuing probe has found the problem to be “widespread.”

A source said “dozens” of charities are part of Cuomo’s investigation, which involves political contributions at various levels of government, including the state Legislature and the City Council.

Federal and state laws bar non-profits from making donations to candidates or officeholders, as well as participating in their campaigns.

Charities that break the law risk losing their tax-exempt status.

Still, many have long quietly forked over campaign cash — often after receiving pork barrel funding from some of the same lawmakers.

For instance, it has been reported that Assemblywoman Rhoda Jacobs (D-Brooklyn) got $2,500 from Maimonides Medical Center in 2006, while later that year, she arranged for a grant to the hospital for a CAT-scanner.

The assemblywoman’s office has said the burden should not be on lawmakers to determine whether groups that give donations to them are nonprofits or not.

Cuomo’s charity investigation grew out of an ongoing probe launched two years ago into pork-barrel spending — known as “member items” — by state lawmakers.

Earlier this month, the Attorney General’s Office sent a strongly worded letter to the director of the Brooklyn Italian Youth Soccer Club, detailing campaign contributions the charity has given to state politicians over the past five years and demanding the organization undertake to be repaid.

“Your organization’s apparent violation of the law may have jeopardized its tax-exempt status, the loss of which would seriously impair its operations and cause harm to its charitable beneficiaries,” reads the Oct. 10 letter, which was obtained by The Post.

“Our office requires that your organization seek an immediate repayment of past political contributions, if it has not done so already,” added the letter, which was signed by the head of Cuomo’s Charities Bureau, Jason Lilien. The letter demands that the nonprofit take steps to ensure similar contributions are not given in the future.

Cuomo ordered the group to inform him of what it is doing to get the money back, within 24 hours of receiving the warning, as well as listing all other contributions made to candidates from 2003 to the present.

According to Cuomo’s letter, the soccer club made nine contributions totaling $1,075 to Assemblymen Peter Abbate and Bill Colton, both Brooklyn Democrats, since 2004.

State comptroller records show the charity had not received any member items in recent years from Albany.

The head of the soccer club could not be reached for comment last night.