NEW YORK (AP) -- A lawyer was sentenced to five years in prison Wednesday for engineering a mammoth fraud that enabled tens of thousands of people who entered the country illegally to gain citizenship.

Attorney Earl Seth David, 49, of Manhattan was sentenced by U.S. District Judge Naomi Reice Buchwald. David was extradited to the United States from Canada last year to face charges that he processed thousands of false immigration applications, earning millions of dollars in fees.

David fled to Canada in 2006 and his law firm closed in 2009. He pleaded guilty last April to one count of conspiracy to commit immigration fraud and one count of conspiracy to commit mail and wire fraud.

Prosecutors said David charged up to $30,000 per client to provide phony employment sponsorships and fabricated documents, including fake pay stubs, fake tax returns and fake "experience letters" purporting to demonstrate that sponsorships were real.

Before he was sentenced, Martin sobbed as he apologized for his crimes.

"I'm ashamed, embarrassed and humiliated for breaking the law," he told the judge. She rejected his claim that he united families as "blatant nonsense."

U.S. Attorney Preet Bharara said David was the 12th defendant to be punished for a fraud that stretched from 1996 until early 2009.

The government said it has identified at least 25,000 immigration applications submitted by David's firm and the vast majority of them were believed to contain false, fraudulent and fictitious information.

It said David and his employees recruited dozens of people to help him by claiming they were sponsoring immigrants. As part of his sentence, he was ordered to forfeit $2.5 million.

Prosecutors said he continued to carry out his fraud from Canada, with illicit profits sent to him through a bank account in the name of a biblical treatise he had authored titled: "Code of the Heart."