How were the charges against Khobragade dismissed?

The US has dismissed charges against Indian diplomat Devyani Khobragade, who was booked for making Sangeeta Richards, her housekeeper and nanny, work 100-hour weeks at a salary of just over $1 an hour, far below the legal minimum US wage of $7.25 an hour.
But on what basis was the federal indictment against her dismissed?
US District Judge Shira Scheindlin in Manhattan ruled that Khobragade, who was India's deputy consul-general in New York, had diplomatic immunity when she sought on 9 January to dismiss the indictment, and thus could not be prosecuted.
Prosecutors had argued that the indictment should stand because Khobragade did not have diplomatic immunity either when she was arrested, or now given that she has left the country.
Scheindlin said, however, Khobragade had that immunity on 9 January when the indictment was issued, having the day before been named a counselor to India's mission to the United Nations.
"Even if Khobragade had no immunity at the time of her arrest and has none now, her acquisition of immunity during the pendency of proceedings mandates dismissal." she wrote. "The government may not proceed on an indictment obtained when Khobragade was immune from the jurisdiction of the court," Scheindlin wrote.
She also lifted Khobragade's bail and said open arrest warrants based on the indictment must be thrown out.
The verdict will come as a huge relief to Khobragade, whose husband and children are still in the US. Her husband is a US citizen. Since her return to India, Khobragade has been employed with the Ministry of External Affairs in New Delhi.
Khobragade's attorney, Daniel Arshack, said the former deputy general consul, now back in her homeland, was pleased by the ruling.
"She is heartened that the rule of law prevailed," he said, adding that a new indictment "might be viewed an aggressive act and one that (prosecutors) would be ill-advised to pursue."
However she cannot rest easy just yet.
The ruling has still left open the possibility prosecutors could bring a new indictment against her, and they "intend to proceed accordingly," said James Margolin, a spokesman for Manhattan US Attorney Preet Bharara.
Agencies

Wildfires ravage parts of Italy, Spain and France, prompting thousands of evacuations
US set to sign Saudi nuclear deal; Rubio says pact won't fuel proliferation
India-US trade deal 'almost complete', says US after Jaishankar-Rubio talks in Manila
Marco Rubio says he 'would expect India to be concerned' over Trump's pharma tariffs
Trump renews China election interference claims, but files point to Russia's larger role

