A Louisville man who worked as a recruiter for a fake university in metro Detroit created by U.S. Immigration and Customs Enforcement as part of a sting operation was sentenced by a federal judge Wednesday to six months in prison, a much lower sentence than the 24 to 30 months prosecutors asked for.

Judge Gershwin Drain of U.S. District Court in Detroit also said that Phanideep Karnati, 36, was free until he had to report for his prison sentence.

But agents with ICE were in the courtroom during his sentencing and immediately took him into custody after his sentencing. As he was led away, his wife and their two boys, ages 3 and 10, wept. On a bench in the hallway, the youngest boy cried out as his mother tried to comfort him in her lap.

Karnati and his family are now out of immigration status because of his conviction. ICE plans to deport him to India after he serves his six months in federal prison.

In handing down his sentence, Drain noted that Karnati had pleaded guilty last year to visa fraud for recruiting 39 students to a university created by ICE. Karnati and other recruiters said they thought the university was legitimate since it was approved on the government's website and by an accreditation agency.

Kentucky legislature:Revised version of Kentucky 'sanctuary' policy ban will go before a legislative committee

Drain told Karnati: "I'm convinced you were guilty." But, the judge added of his offense: "It's serious, but it's not all that serious. ... You have a very clean record, you got a family. ... I view you as a little less culpable" than the other recruiters, who received longer sentences, ranging from 12 to 24 months.

Karnati arrived legally in the U.S. about 10 years ago with a H1-B visa while the other recruiters were on F1 student visas, which were the basis for their legal status, court records show. His sentencing memo said this is one reason why he should receive a lighter sentence. Unlike the other recruiters charged, Karnati was not sent to jail after the January 2019 indictments because he had legal immigration status.

Over the years, he worked in data science and information technology for several companies, most recently at an insurance company. He had earned a master's degree in data analytics from the University of Louisville and was in a Ph.D. program in computer science and engineering.

The judge said that even if Karnati may have initially thought the university was legitimate he later knew it was not a legitimate operation: "You knew it was totally fraudulent."

In his plea deal, Karnati admitted he thought the university had online classes for foreign students. It's not legal for students admitted on F1 visas to only take online classes.

Detroit Free Press reports on Nov. 27 and last month sparked national interest in the case, with the undercover sting drawing criticism from several elected officials, including Sens. Elizabeth Warren, D-Mass., and Kamala Harris, D-Calif., and U.S. Rep. Alexandria Ocasio-Cortez, D-N.Y. Warren wrote a letter two weeks ago to Education Secretary Betsy DeVos saying the fake university was "anti-immigrant."

More than 600 students, mostly from India, were enrolled at the university, which had a website, a backstory and university officials who were actually undercover agents. ICE has arrested about 250 students so far, deporting or removing about 80% of them.

Signifying the importance of the case, the sentencing Wednesday was attended by U.S. Attorney Matthew Schneider for the Eastern District of Michigan and the head of ICE's investigative division, Homeland Security Investigations, for Michigan and Ohio Vance Callender.

Speaking after the sentencing, Schneider said of the students at the fake university: "They were not students. They were frauds. ... They knew exactly what they were doing. And they knew it was wrong."

Asked about Warren's letter that said the undercover operation was "anti-immigrant," Schneider said: "It's not anti-immigrant to enforce the law" against fraudulent students.

"This is pro-immigrant," Schneider said of the sting operation and criminal charges against the recruiters. "It's protecting the immigrants who do the right thing."

More:ICE arrests 90 more students at fake university in Michigan

Callender praised the agents involved in the undercover case, which started in 2015.

"They did an excellent job" working long hours on the case, Callender said outside the courtroom. "It's a detailed process."

The operation was part of ICE's efforts to "protect the homeland," he said.

In a statement released by ICE, Callender said: “Today’s sentencing of the final criminal defendant in HSI’s University of Farmington investigation makes it unequivocally clear that every individual who participated in this scheme knew it was an illegal pay-to-stay scam.

Building off lessons learned from the September 11 attacks, HSI is dedicated to protecting the homeland in part by ensuring the integrity of the Student Visa Program so it can continue to benefit everyone. Unscrupulous schools whose sole motive is profit and not education do exist and this investigation not only exposed these types of criminals, but has helped create a feeling of omnipresence by law enforcement that will make others think twice before exploiting the program.”

In addition to family members, some friends and supporters of Karnati were in the courtroom to show support.

"It's extremely sad," said Vamsi Krishna. "It's unfair."

The day of sentencing was the birthday of Karnati's older son, who turned 10, he said.

Joe Gerth:Immigration? Voter ID laws? Kentucky Senate's priority bills are jokes

Karnati's attorney, Anjali Prasad, told the court before the judge gave his sentence that Karnati should not be sent to prison because he thought the university was legitimate. She cited phone conversations recorded by ICE between undercover agents and students that she said indicated the students thought the university had classes when they enrolled.

Prasad said she was pleased with the six-month sentence, but added that it's unfortunate that ICE had to take him into custody immediately. She added that she knew his could happen because Karnati had lost his immigration status after being sentenced.

"It doesn't extend his federal sentence, it just means ICE processes him sooner rather than later," Prasad said after the sentencing.

Addressing the judge, Karnati pleaded for mercy.

"I trusted the University of Farmington was genuine," he said. "I relied on the website" and the listing "by government agencies" that it was legitimate.

More:Emails show how fake university in metro Detroit lured students

More:Undercover ICE recordings reveal tactics of fake Farmington University

"I swear if I had known" the university was a scam, "I would have never" recruited for it, he said.

"I apologize to the U.S. government," he said. "I should have done more" research to find out if the university was legitimate.

"I ruined my beautiful life and career. ... I beg your mercy."

In calling for a stiff sentence, Assistant U.S. Attorney Tim McDonald told the court that Karnati "lied to arresting officers" about his involvement with the University of Farmington. For example, he said Karnati had told officers he was paid $200 each for recruiting students when it was actually $300.

Karnati was arrested on Jan. 29, 2019, at Detroit Metro Airport. He had traveled to Michigan planning to meet with university officials when agents arrested him.

McDonald said that in a secretly recorded meeting in June 2018 attended by Karnati with an undercover agent posing as the university president, "I counted nine times" where there were references made about "the University of Farmington had no classes."

McDonald said the evidence shows that Karnati was aware the university had no classes.

In his plea deal, Karnati said he thought the university had online classes.

Contact Niraj Warikoo: nwarikoo@freepress.com or 313-223-4792. Twitter @nwarikoo