An Oceanside man was sentenced to 15 years in prison in Brooklyn federal court on Tuesday for masterminding a $3.5 million scheme to fraudulently collect fees from thousands of homeowners for mortgage modifications, as well as other scams, the government said.

David Gotterup, 37, controlled a series of companies from 2008 to 2012 that used telemarketers and salespeople to convince homeowners to pay advance fees for help with distressed mortgages, and then provided no services, prosecutors said.

advertisement | advertise on newsday

He was also involved in schemes to defraud mortgage lenders, the Federal Housing Administration and the Small Business Administration, prosecutors said. Gotterup has been imprisoned since his arrest in 2015, and pleaded guilty last June.

He was sentenced by U.S. District Judge Nicholas Garaufis. His lawyer did not immediately return a call for comment.