BOSTON — A Massachusetts father and son have been sent to prison for running an elaborate lottery fraud scheme designed to enrich themselves and help prize winners avoid paying taxes on their windfall winnings, prosecutors said.

Ali Jaafar, 63, and Yousef Jaafar, 29, both of Watertown, cashed 14,000 winning lottery tickets over a period of about 10 years, laundered more than $20 million in proceeds, then lied on their tax returns to deceive the IRS. about $6 million, the US attorney’s office in Boston announced Monday.

The Jaafars bought discounted winning lottery tickets from people who wanted to avoid identification by the state lottery commission, which withholds taxes and outstanding child support payments from payments.

After purchasing the tickets, using the stores that sold them as intermediaries, the Jaafars claimed the full amount of the prize. Although they reported the winnings on their tax returns, they also claimed equivalent false gambling losses as compensation to avoid federal income taxes, prosecutors said.

Ali Jaafar was sentenced to five years in prison. Yousef Jaafar received a sentence of more than four years. They were also ordered to pay $6 million in restitution and forfeit the proceeds of their scheme.

They were convicted in December of conspiracy to defraud the IRS, conspiracy to commit money laundering and filing a false tax return.

Mohamed Jaafar, another of Ali Jaafar’s sons, pleaded guilty to his role in the scheme in November and is awaiting sentencing.

The defendants paid the owners of dozens of stores that sell lottery tickets to facilitate the transactions, and the state lottery commission is in the process of revoking or suspending the licenses of more than 40 lottery agents, authorities said.