President Donald Trump on Wednesday pardoned longtime ally Michael Flynn, a move that comes amid months of wrangling in court over whether a judge would allow the U.S. Justice Department to back away from its false-statements prosecution despite the former national security adviser having earlier pleaded guilty to lying to the FBI.

The pardon, announced on Twitter, followed a pattern for Trump, who broadly has used the clemency power of the presidency to help allies and associates. Months ago, Trump commuted the prison sentence of longtime confidante Roger Stone, who had been convicted at trial in Washington on a host of offenses. Stone remains a felon.