US President Donald Trump has accused Attorney General Jeff Sessions and the justice department of damaging the re-election chances of two Republican representatives by prosecuting them.
The move to file charges against the men had jeopardised "easy wins" in the mid-term elections, Mr Trump tweeted.
One is accused of insider trading and the other of campaign violations.
The tweet has sparked fresh criticism that Mr Trump is illegally seeking to interfere with the justice system.
It is highly unusual for sitting presidents to lash out against attorneys general and to try to bring political considerations to bear on prosecution decisions.
What's at stake?
It comes ahead of the mid-term elections on 6 November. The Democrats are seeking to wrest control of the House of Representatives from the Republicans.
Read more about America's November elections:
Last month Representative Christopher Collins was charged with participating in an insider trading scheme. He has denied wrongdoing but said he would not seek re-election.
Later in August Representative Duncan Hunter and his wife were indicted for allegedly using campaign funds to pay for personal expenses. They too deny the charges.
Both men were early supporters of Mr Trump when he launched his bid for the presidency and was facing hostility from Republican congressional leaders.
In a tweet, Mr Trump criticised the prosecution of "two very popular Republican Congressmen".
Two long running, Obama era, investigations of two very popular Republican Congressmen were brought to a well publicized charge, just ahead of the Mid-Terms, by the Jeff Sessions Justice Department. Two easy wins now in doubt because there is not enough time. Good job Jeff......— Donald J. Trump (@realDonaldTrump) September 3, 2018
The investigation into Mr Hunter began under the presidency of Barack Obama, but the Collins inquiry was launched last year.
The justice department has not commented on the tweet. But it has drawn fire from a number of critics, including Mr Trump's fellow party members.
Republican Senator Ben Sasse said the justice department should remain politically neutral in deciding whether or not to prosecute.
"The United States is not some banana republic with a two-tiered system of justice - one for the majority party and one for the minority party. These two men have been charged with crimes because of evidence, not because of who the president was when the investigations began," he said.
Democratic Senator Patrick Leahy said: "Now we have a president who has declared in the last 24 hours that the department of justice shouldn't prosecute Republicans. It's Alice in Wonderland."
US political scientist and columnist Brian Klass called Mr Trump's outburst "insane".
No exaggeration: if any other elected leader in a Western democracy tried to instruct their top law enforcement official to shield their political allies from prosecution for political reasons like this, they would be forced to resign within hours. This is insane. https://t.co/i8HpCpDjm0— Brian Klaas (@brianklaas) September 4, 2018
Other critics argue that mid-term elections are not a good reason to delay prosecution.
Mr. President,— Steven Kleinman (@SMKleinman) September 4, 2018
Are you suggesting that members of Congress are above the law? The Department of Justice clearly has sufficient evidence to charge Mssrs. Collins and Hunter with felonies. The courts shall decide their guilt or innocence.
This is disgraceful.
How have Trump's relations with Sessions soured?
The president has been a vocal critic of the justice department and has frequently clashed with his attorney general.
The criticism began in the early months of the administration last year, when Mr Sessions recused himself from investigations into claims that Russia tried to help Mr Trump win the 2016 election.
The attorney general, a staunch conservative and early supporter of Mr Trump's campaign, handed control to his deputy to avoid a potential conflict of interest. Mr Trump regarded that move as a "betrayal".
The deputy in turn appointed ex-FBI director Robert Mueller as special counsel to lead the inquiry, which the president has repeatedly called a "witch hunt".
Mr Trump is widely believed to have lost faith in Mr Sessions.
In a recent interview with Bloomberg, he said: "I do question what is Jeff doing." Asked if he would retain his attorney general beyond the midterms, he declined to comment.
Donald Trump's problem
Analysis by BBC's North America reporter Anthony Zurcher
Donald Trump has questioned his attorney general's decision not to be involved in the Russia investigation. Now he's angry about investigations Mr Sessions is overseeing.
While Mr Trump may be concerned that the justice department is taking legal actions unnecessarily close to a national election - something its guidelines caution against - his tweet constitutes yet another violation of standards of presidential conduct with regard to federal investigations that date back to the post-Watergate era.
It also represents yet another swipe at what he has called his "beleaguered" attorney general.
Although Mr Trump has said he won't review Mr Sessions' job status until after the election, it's hard to imagine the current level of tension lasting indefinitely.
The problem for the president, however, is that with every hostile tweet he makes it that much harder to replace Mr Sessions.
Who would want a job subjected to such pressure? And what type of candidate who satisfies Mr Trump's desire for loyalty would survive a Senate confirmation vote?
In what could be the president's greatest trick, a recent poll showed that 75% of Democrats support keeping the hard-core conservative Session on the job.
They may get their wish … for now.