BANGOR, Maine — One of the country’s most sophisticated marriage fraud schemes officially ended Tuesday when a federal judge sentenced the last defendant to a year in prison.

Margaret Kimani, 30, of Worcester, Mass., was one of 28 defendants convicted in Maine of being part of a scam that paid American citizens living in Maine to wed African immigrants so they could more easily obtain permanent residency status, known as a green card, and achieve citizenship more easily, Maine’s U.S. Attorney Thomas E. Delahanty II said at a press conference after the sentencing.

“America’s legal immigration system is not for sale and we will move aggressively against those who willfully compromise the integrity of that system simply to enrich themselves,” said Bruce Foucart, special agent in charge for U.S. Immigration and Customs Enforcement’s Homeland Security Investigations in Boston, whose office headed the investigation that led to the prosecutions.

“HSI’s message is very simple,” he said at the press conference. “U.S. citizenship is not for sale and there are consequences for those who commit marriage fraud. If you commit marriage fraud, there isn’t going to be a honeymoon.”

The investigation was launched in 2005 and identified more than 40 sham marriages in the Lewiston/Auburn and Newport areas between U.S. citizens in Maine and nationals from Kenya, Uganda, Zambia and Cameroon. Prosecutions began in 2010.

The scheme was hatched by Rashid Kakande, 41, of Lexington, Mass., and James Mbugua, 53, of Springfield, Mass., according to court documents. The men had family connections in Lewiston. They recruited sisters Angela Roy, 40, of Sabattus and Torri Roy Patterson, 36, of Lewiston, who recruited other Mainers to marry foreign nationals, most of whom lived in Massachusetts, according to Foucart.

Immigrants seeking an American spouse would pay Kakande or Mbugua between $1,000 and $1,500, Foucart said Tuesday. Out of that fee, the men would pay the sisters and the spouses. Kimani’s husband was paid $500 to marry her. Spouses who provided false information, such as joint bank accounts, rent receipts and utility bills to show that the couple was living together, and attended interviews with immigration officials received further payments.

Assistant U.S. Attorney Gail Malone, who prosecuted all of the cases, said at the press conference that Kakande and Mbugua targeted Maine because there is no waiting period for marriage in the state as there is in New Hampshire and Massachusetts. She said that although the investigation spanned Massachusetts, New Hampshire, Vermont and Maine, the only prosecutions were in Maine and no cases are pending in other states.

Kimani and three other defendants were the first in the nation prosecuted for filing false claims of spousal abuse with U.S. immigration authorities in violation of the Violence Against Women Act, Delahanty said. The act allows immigrants, who are subject to abuse, to apply for permanent residence without the knowledge or consent of their U.S. spouse.

Foucart said that eight of the 18 foreign nationals convicted have been deported. He said that three others are considered to be fugitives. Foucart said that removal proceedings are pending against the rest.

Sentences in the case ranged from probation to the two years in prison ringleader Kakande originally was sentenced to in June 2011. In April 2012, his sentence was amended to 19 months, after he testified against another defendant, Malone said Tuesday.

Kakande, who is a U.S. citizen, also was ordered to pay a $20,000 fine, the amount the judge estimated he made arranging sham marriages. He was released in August 2012, according to the U.S. Bureau of Prisons’ Inmate Locator website.

Mbugua, who arranged Kimani’s marriage, disappeared in 2010 before he could be tried and is listed as a fugitive on the court’s electronic case filing system.

In addition to prison time, U.S. District Judge John Woodcock sentenced Kimani in U.S. District Court to three years of supervised release. Kimani, who is a licensed practical nurse and has a daughter who is a U.S. citizen, is expected to be deported.

Kimani married a Maine man in Lewiston on Dec. 30, 2003, nearly two years after her visitor’s visa expired Feb. 3, 2002, in order to gain U.S. citizenship more easily, according to court documents.

She was indicted by a federal grand jury in August 2012 but was not arrested until 13 months later when she returned from a visit to her native Kenya. She has been held without bail since her arrest Sep. 5, 2013, at JFK International Airport in New York City. A jury found her guilty of one count of conspiracy to defraud the U.S. in December.

Kimani was awarded lawful permanent residency in March 2010 based on the false information that her husband sexually, physically and emotionally abuse her, according to the prosecutor.

She faced up to five years in prison and a $250,000 fine. Under the prevailing federal sentencing guidelines, she faced six to 12 months in prison. The time that she has been held will be credited to her sentence.