A federal judge ordered Paul Manafort to jail Friday over charges he tampered with witnesses while out on bail — a major blow for President Trump’s former campaign chairman as he awaits trial on federal conspiracy and money-laundering charges next month.

“You have abused the trust placed in you six months ago,” U.S. District Judge Amy Berman Jackson told Manafort. “The government motion will be granted, and the defendant will be detained.”

The judge said sending Manafort to a cell was “an extraordinarily difficult decision” but said his conduct — allegedly contacting witnesses in the case in an effort to get them to lie to investigators — left her little choice.

“This is not middle school. I can’t take away his cellphone,” she said. “If I tell him not to call 56 witnesses, will he call the 57th?” She said she should not have to draft a court order spelling out the entire criminal code for him to avoid violations.

“This hearing is not about politics. It is not about the conduct of the office of special counsel. It is about the defendant’s conduct,” Jackson said. “I’m concerned you seem to treat these proceedings as another marketing exercise.”

Manafort was led out of the courtroom by security officers. He turned and gave a last look and wave to his wife, seated in the well of the court. She nodded back to him.

His attorney Richard Westling had urged the judge not to send him to jail, saying that it was not required by law and that doing so “will create more challenges for the defense, which already faces trial in two courts.”

The order to incarcerate Manafort capped a months-long fight over the terms of his bail. He had been confined to his home on electronic monitoring and other restrictions since he was first indicted Oct. 27 during special counsel Robert S. Mueller III’s probe of Russian interference in the 2016 presidential election. Manafort had been asking to post a $10 million bond and end the seven months of home detention.

By just before 8:30 p.m. Friday, jail records indicate, he had been processed into the Northern Neck Regional Jail in Warsaw, Va., prisoner number 45343, about 90 miles southeast of Washington.

The jailing order marked the latest fall for the political power broker and confidant of Republican presidents dating to Ronald Reagan.

“Wow, what a tough sentence for Paul Manafort, who has represented Ronald Reagan, Bob Dole and many other top political people and campaigns,” Trump tweeted Friday afternoon, just before turning his attention to former FBI director James B. Comey and Hillary Clinton. “Didn’t know Manafort was the head of the Mob. What about Comey and Crooked Hillary and all of the others? Very unfair!”

Hours earlier, Trump had defended Manafort in remarks to reporters outside the White House, saying his former campaign chairman “has nothing to do with our campaign, but I tell you I feel a little badly about it. They went back 12 years to get things that he did 12 years ago.”

Trump added that Manafort “worked for me for a very short period of time.” In 2016, Manafort served as Trump’s campaign chairman during the Republican National Convention.

Asked whether he might consider pardoning former aides and advisers, Trump answered, “I don’t want to talk about that.”

But Rudolph W. Giuliani, a Trump attorney, told the New York Daily News on Friday that the Mueller investigation “might get cleaned up with some presidential pardons.”

Giuliani later backtracked from his suggestion pardons might be coming. “Our advice is not to do it,” he told The Washington Post. “It would have to be way down the road. There should be no pardons.”

Prosecutors alleged that by committing a new crime while on release, Manafort violated the terms of his home confinement in Alexandria, Va., and they asked the judge to revoke or revise it.

Manafort, 69, has pleaded not guilty to all charges in what prosecutors say was a broader conspiracy to launder more than $30 million over a decade of undisclosed lobbying for a pro-Russian former politician and party in Ukraine.

The case against him includes failing to register in the United States as a lobbyist for a foreign government. On June 8, he and a Russian business associate were charged with obstruction of justice after prosecutors say they tried to persuade two potential witnesses to tell investigators the Ukraine lobbying effort did not include activity in the United States.

Manafort’s attorneys have denied the tampering allegations and accused prosecutors of conjuring charges to pressure him to flip his plea and turn against Trump and his associates.

Manafort was arraigned Friday on the obstruction counts and is set for trial in Washington in September over the allegations of secret lobbying. He also faces a federal trial in Virginia in July for related tax- and bank-fraud charges brought as prosecutors reviewed his financial dealings.

Most of the criminal counts relate to activity that preceded Manafort’s time as Trump’s campaign manager from March to August of 2016, when he resigned amid news reports that he had received secret cash payments for his Ukraine consulting.

Prosecutors had previously complained to the judge about Manafort’s behavior as he awaited trial. In December, they accused him of violating a court’s gag order by helping ghostwrite an op-ed piece defending his work in Ukraine for an English-language newspaper in Kiev, the Ukrainian capital.

Jackson, the judge, declined to punish Manafort then but warned she would probably consider similar actions in the future as a violation.

In asking for Manafort to be jailed, prosecutor Greg Andres said in court that there was a danger Manafort would continue to commit crimes.

Andres summarized what he called “a sustained campaign over a five-week period” by Manafort to reach the two witnesses and influence their testimony.

In addition to the texts and phone calls cited in the government’s earlier filing, Andres said one of the witnesses had provided an affidavit through his lawyer about one call from Manafort that was completed.

“We learned about it because a witness in this case brought forward information about the tampering. That’s when we started investigating,” Andres said, adding: “There is no way to monitor Mr. Manafort’s communications. At the least, he has shown he is adept” at making them.

As both sides discussed the witness-tampering allegation, Westling urged the judge to consider options short of jail that could be added to the existing terms of his release “that can prevent this from occurring in the future.” He said a no-contact order with others in the case could achieve that result and said the current release terms had not explicitly included that restriction.

Andres replied that “it’s inconceivable that [Manafort] doesn’t know that they’re potential witnesses.”

The fall indictment of Manafort and his longtime deputy, Rick Gates, marked the first public charges in the special-counsel investigation. Gates, 46, pleaded guilty in February to lying to investigators and agreed to provide information in a cooperation deal with Mueller’s team.

Manafort has repeatedly declared his intention to fight the charges in both jurisdictions, with his attorneys saying that he is being wrongly prosecuted for financial activities that have nothing to do with Russian interference in the 2016 election, the main focus of Mueller’s investigation.

Prosecutors have said that Manafort’s role in the campaign and long-standing ties to Russian-backed politicians, financiers and others merited investigation into whether any of them served as back channels to Russia.

The obstruction charges flow out of lobbying work in 2012 on behalf of Ukraine’s pro-Russian president at the time, Viktor Yanukovych, and his Party of Regions.

A Manafort associate, Konstantin Kilimnik, also was charged with obstruction in connection with the alleged approaches to witnesses. Kilimnik is believed to be in Moscow — and therefore safe from arrest because Russia does not extradite its citizens. Prosecutors have previously said Kilimnik has ties to Russian intelligence, which he denies.

Josh Dawsey contributed to this report.