DINESH D’SOUZA made his name making racially accented digs at Barack Obama. He mocked the teenage survivors of the recent school shooting in Parkland, Florida. He claimed that the fatal white supremacist rally in Charlottesville, Virginia, was staged. The conservative writer is also a convicted criminal. In 2014 he was convicted of campaign-finance fraud, to which he pleaded guilty, and was sentenced to five years of probation, which he himself described as “fair”. On May 31st, President Donald Trump said he would pardon Mr D’Souza, declaring on Twitter that he was “treated very unfairly by our government!”

This is the fifth pardon Mr Trump has issued 16 months into his presidency. His three predecessors had issued one or none at a comparable stage. And Mr Trump says he is considering absolving more crimes. He thinks he might pardon Martha Stewart (pictured), the lifestyle guru who did time after lying to investigators about the timing of a sale of biotech shares. He is also considering commuting the sentence of Rod Blagojevich, the former Democratic governor of Illinois, who was convicted of corruption charges that included trying to flog Barack Obama’s Senate seat.

Mr Trump’s method of wiping the slate clean also departs from the usual presidential practice of accepting recommendations from the Department of Justice on felons deserving of a pardon, most of whom are unknown. Instead, his personal connections have guided him. Senator Ted Cruz reportedly lobbied for Mr D’Souza’s pardon. Mr Blagojevich appeared on “Celebrity Apprentice”, Mr Trump’s reality TV programme. Ms Stewart hosted a spin-off of that show.

Mr Trump is not the first president to have pardoned old associates. Bill Clinton came to rue his last-minute pardon of Marc Rich, a fugitive financier as “terrible politics”. But Mr Trump’s pardoning spree is not just a worrying departure from presidential norms because he appears to be rewarding allies. He is also taking a swing at those who helped convict them. The cases of Ms Stewart, Mr Blagojevich and Mr D’Souza were all prosecuted by men who have become outspoken critics of the president. Ms Stewart was prosecuted by James Comey, as the former FBI director wrote in his recently published memoir. Mr Blagojevich was prosecuted by Patrick Fitzgerald, a friend of Mr Comey’s, who last year joined his legal team. Mr D’Souza was prosecuted by Preet Bharara, a former US attorney in New York, whom the president fired last year.

This has created an impression that Mr Trump is using his pardoning power to encourage old friends caught up in Robert Mueller’s investigation into his campaign team’s dubious activities to stay loyal—and enemies to back off. Mr D’Souza’s pardon may have particular resonance for Michael Cohen, Mr Trump’s lawyer, who faces the possibility of criminal charges including violations of federal campaign-finance laws. Laurence Tribe, a Harvard law professor, tweeted on May 31st that Mr Trump’s actions were “an elephant-whistle to Michael Cohen & all who know damning things about Trump: protect me & I’ll have your back. Turn on me & your goose is cooked. More obstruction!”

Mr Trump used earlier pardons as a weapon to attack the judiciary. His first and perhaps most shameless pardon, of Joe Arpaio in August last year, was an unmistakable middle finger to the federal judges who had convicted the former sheriff of Maricopa County, Arizona, of contempt of court. Mr Arpaio, a supporter of Mr Trump’s anti-immigrant policies, who is now running for a Senate seat in Arizona, had directed his deputies to stop anyone they thought might be in the country illegally, even if they were not suspected of a crime. The courts said this was racial profiling and convicted him of ignoring an order to stop it. Mr Trump, who pardoned him a month later, said, “I thought he was treated unbelievably unfairly”.

Even other, less controversial pardons have been cast by the president as a correction of injustice, rather than the forgiveness of a proven crime that presidential pardons properly are. In April when Mr Trump pardoned Lewis “Scooter” Libby, an aide in George W. Bush’s administration, who was convicted of perjury, he said that Mr Libby had been “treated unfairly”. His pardon of Kristian Saucier, a navy sailor convicted of illegally keeping pictures of a submarine, meanwhile, was nakedly political: on the campaign trail Mr Trump had compared Mr Saucier’s unjust sentence to Hillary Clinton’s freedom.

In a post-pardon tweet on May 31st, Mr D’Souza celebrated the enormous favour the commander-in-chief had done him. “KARMA IS A BITCH DEPT: @PreetBharara wanted to destroy a fellow Indian American to advance his career,” he wrote.  “Then he got fired & I got pardoned.”