Former Trump campaign chairman Paul Manafort has been moved from a minimum-security prison near Scranton, Pa., to the federal detention center in Manhattan used to hold the notorious Mexican drug lord known as “El Chapo,” federal records show.

The move to the Metropolitan Correctional Center in New York City comes as Manafort is expected to appear in court there on state mortgage fraud charges. The New York Times and Fox News Channel had previously reported that Manafort probably would be headed to the notorious Rikers Island prison, but the district attorney’s office disputed whether that had been decided, and a Justice Department official said it has now been determined that Manafort will remain in federal custody after his attorneys raised concerns about his “health and personal safety.”

The official said the attorneys proposed that Manafort stay in federal custody but be turned over to the state as needed, and New York prosecutors did not object.

“In light of New York’s position, and Mr. Manafort’s unique health and safety needs, the department determined to err on the side of caution by keeping Mr. Manafort in custody during the pendency of his state proceedings,” said the official, who spoke on the condition of anonymity to discuss internal deliberations. Manafort would be made available as needed, and the arrangement would not affect his state case, the official added.

Manafort previously had been serving time for federal crimes at the minimum-security prison camp at the U.S. Penitentiary, Canaan, in Pennsylvania.

He drew particular attention during an investigation by special counsel Robert S. Mueller III into possible coordination between the Kremlin and President Trump’s 2016 campaign for his business involving Ukraine and contacts with people connected to Russia.

Ultimately, Manafort was charged with offenses related only to his Ukraine work — not for a conspiracy with Russia. He was convicted in August of tax- and bank-fraud charges after a weeks-long trial in federal court in Virginia, and he later pleaded guilty in a separate case in federal court in Washington.

Although Manafort admitted wrongdoing and agreed to cooperate with law enforcement, prosecutors accused him of lying even after that. He was sentenced to 7 ½ years in prison across both cases. Then, in March, he was indicted by a state grand jury in New York on charges of mortgage fraud — a case that some analysts viewed as a safeguard in case Trump sought to pardon him for the federal crimes. The president cannot issue a pardon for state offenses.

When the New York charges were announced, Trump said a pardon for Manafort was “not something that’s right now on my mind,” but he added, “I do feel badly for Paul Manafort, that I can tell you.” Manafort’s attorneys are likely to argue that the state case is a form of double jeopardy because the alleged mortgage fraud stems from the same conduct that led to the federal case against Manafort. An attorney for Manafort did not immediately return messages Tuesday.

Manafort’s time in federal custody has at times sparked controversy. Last summer, when he was at a facility in Northern Neck, Va., awaiting his federal trial, prosecutors alleged that he had told people he was treated like a “VIP,” because he had his own phone and computer and did not have to wear an inmate uniform.

Because of his case’s high profile, the Federal Bureau of Prisons maintained regular communication with Justice Department leaders about Manafort’s status, people familiar with the matter said, speaking on the condition of anonymity to discuss the talks.

On May 3, New York requested Manafort’s transfer to its custody — which probably would have put him at Rikers Island — until after his state trial was completed, according to a letter Manafort’s attorney wrote to the prison warden in Pennsylvania.

According to the letter, dated May 17, New York had rejected a request from Manafort to remain in Pennsylvania while awaiting trial. Todd Blanche, Manafort’s attorney, asked the warden to intervene so that Manafort could return to Pennsylvania after his arraignment in New York.

Blanche argued that the Pennsylvania camp was “an appropriate facility in light of Mr. Manafort’s security needs,” while Rikers Island — where Manafort could spend months or years in solitary confinement while awaiting trial — “clearly is not.”

“Even if Mr. Manafort were housed at a facility other than Rikers Island, it would not serve anyone’s interests for him to be kept in a pretrial detention facility in the New York City area while awaiting trial in the Case,” Blanche wrote.

The Times and Fox News reported in early June that Manafort was expected to be transferred to Rikers within a few weeks. The facility has a fearsome reputation, and the Times reported that Manafort probably would be held in isolation. Rep. Alexandria Ocasio-Cortez (D-N.Y), whose district includes the facility, criticized the reported move at the time.

“A prison sentence is not a license for gov torture and human rights violations,” she said on Twitter. “That’s what solitary confinement is. Manafort should be released, along with all people being held in solitary.”

But the plans, it seems, were still in flux. On June 11, Deputy Attorney General Jeff Rosen, the No. 2 official at the Justice Department, forwarded Blanche’s letter to the warden to Manhattan District Attorney Cyrus R. Vance Jr. and asked for his thoughts.

Vance responded three days later, saying his office had “never taken the position that Mr. Manafort should be housed at Rikers Island.” Christopher R. Conroy, chief of the Manhattan district attorney’s major economic crimes bureau, separately wrote to the warden, noting that state prosecutors were willing to have Manafort stay at a federal facility in New York, such as the Metropolitan Correctional Center.

Conroy said the district attorney’s only concern was that Manafort be made available for court proceedings in a “timely manner.” He noted that keeping Manafort in Pennsylvania with only brief excursions to New York for court appearances would be a “departure from usual practice,” although he said the office also was open to such an arrangement.

The Justice Department ultimately decided that Manafort should be moved to the Metropolitan Correctional Center.

Some legal analysts said Manafort seemed to be receiving preferential treatment. “This is not a good start for Rosen,” Matthew Miller, a former Justice Department spokesman, wrote on Twitter. “Lots of inmates complain about where they’re held — almost none get the Deputy AG’s attention.”

But the Metropolitan Correctional Center is no five-star hotel; a prisoner who spent time there and at Guantanamo Bay in Cuba famously said the military’s detention complex for terrorism suspects was “more pleasant” and “more relaxed.” The correctional center, which houses about 800 inmates, has been home to its share of high-profile detainees, including Joaquín “El Chapo” Guzmán and Bernie Madoff, who was convicted of orchestrating the biggest Ponzi scheme in history.

The Bureau of Prisons declined to provide details about Manafort’s detention at the Manhattan center.