They told the banks they were millionaires, and the welfare agencies that they were broke.

Fifteen members of a prominent Satmar Hasidic family were charged in a sprawling fraud case in New York on Thursday, accused of lying to obtain $20 million in mortgages while also receiving hundreds of thousands of dollars in public benefits.

The indictment was accompanied by arrests of 13 members and associates the Rubin family in Williamsburg, Kiryas Joel, and Monsey.

“As alleged, the scheme carried out by the Rubins and others ripped off banks, welfare programs, and taxpayers,” U.S. Attorney Preet Bharara said in a statement. “It ranged from 2004 to 2014, from Brooklyn to Harlem to Orange County, and the individuals involved alternately played the parts of prince or pauper, depending on which scam was being perpetrated.”

Family members allegedly provided false information to obtain $20 million in mortgages, then failed to pay most of them back. They used the money to pay credit card debts, their own home mortgage payments, and to fund other real estate projects.

At the same time, seven family members are accused of lying to receive hundreds of thousands of dollars in Medicaid and food stamps.

According to the indictment, Yehuda Rubin, an organizer of the scheme, claimed an income of just $180 a month along with his wife Rachel Rubin to qualify for public benefits — while at the same time claiming a joint income of $31,000 a month to qualify for a loan.

Another defendant, Samuel Rubin, claimed an income of $200 a week and $0 in financial resources while applying for public benefits. On a loan application, he claimed $350,000 in annual income and a $10 million net worth.

Prosecutors are asking the family to forfeit $24 million worth of property and cash that the government claims the family obtained through the fraud, including buildings and apartments in Williamsburg, Manhattan, and Kiryas Joel.

Fourteen of the fifteen defendants are charged with conspiracy to commit bank and wire fraud, which carries a maximum penalty of 30 years in prison, and with conspiracy to make false statements to lenders, which carries up to a 5 year penalty. Other charges against individual defendants include aggravated identity theft and, against Yehuda, Rachel, and Samuel Rubin, among others, theft of government property.

The family members live in Kiryas Joel and Brooklyn. Another defendant, a real estate appraiser named Pinchus Glauber, lives in Chestnut Ridge.