A Long Island physician whose online chats with an underage girl who lives abroad developed into a sexual relationship was sentenced by a federal judge on Friday to 17 years in prison.

Hassan Khan, 28, of Mineola, had pleaded guilty in January before U.S. District Court Judge Jed S. Rakoff of the Southern District of New York in Manhattan to coercion and enticement of a minor to engage in illegal sexual activity.

While U.S. Attorney Preet Bharara said, “The 17-year sentence imposed on Hassan Khan is a measure of his appalling crime,” Kahn’s attorney, Jeffery Greco of Manhattan, called it disproportionate to the crime.

“Jared Fogle, the Subway pitchman, got less time than my client got,” Greco said, adding that he has represented people who were convicted of murder and drug trafficking who received less prison time. “It was a completely egregious sentence considering the facts of this case. That’s not to say that Khan didn’t admit to his wrongdoing. He did.”

advertisement | advertise on newsday

Last November, Fogle was sentenced to more than 15 years in prison by U.S. District Court Judge Tanya Walton Pratt, in Indianapolis, after he pleaded guilty to having sex with minors and distributing child pornography.

Khan, who Greco said broke down and cried in court after hearing the sentence, will also be subject to 10 years of post-release supervision and must register as a sex offender for life, Greco said. Kahn still has his medical license but Greco said he expected authorities to soon move to suspend and revoke it.

The sentencing is the culmination of an online relationship that began in 2007, when the victim was 11 years old, and continued until about 2013. Khan started having conversations with her in the chat room of an online game, maintained contact over several years and, during an overseas visit, had sex with her while she was still underage, according to prosecutors.

“Khan further coerced and enticed the Victim to engage in sexually explicit conduct via live video chats,” prosecutors said in a news release.

He was arrested on Sept. 3, 2015, and has been in custody since he pleaded guilty in January.