Trump has also been angry that the Justice Department did not publicly announce it was investigating Hunter Biden ahead of the election, despite department policy against such a pronouncement.
Barr in his resignation letter said he updated Trump today on the department's "review of voter fraud allegations in the 2020 election and how these allegations will continue to be pursued."
He added that his last day on the job would be December 23.
Trump said Deputy Attorney General Jeff Rosen, whom he labeled "an outstanding person," will become Acting Attorney General.
Trump spent much of the day watching the Electoral College tally and calling allies but broke away to meet with Barr.
His tweet about Barr's exit was an unusually heartfelt response from a President who is notoriously cold to his departing staff and quick to name-call and deride them once they say they are leaving.
The President has previously claimed he fired staffers who resigned to make himself appear more powerful.
Despite Trump's obvious disdain for those who publicly disagree with him, Barr had generally remained in the President's good graces and has been one of the president's most ardent allies.
Before the election, he had repeatedly raised the notion that mail-in voting could be especially vulnerable to fraud during the coronavirus pandemic as Americans feared going to polls.
But Trump has a low tolerance for criticism, especially public criticism, from his allies and often fires back in kind.
Barr, who was serving in his second stint as attorney general, sought to paint himself as an independent leader who would not bow to political pressure. But Democrats have repeatedly accused Barr of acting more like the president's personal attorney than the attorney general, and Barr had proved to be a largely reliable Trump ally and defender of presidential power. Before releasing special counsel Robert Mueller's full report on the Russia investigation last year, Barr framed the results in a manner favorable to Trump even though Mueller pointedly said he couldn't exonerate the president of obstruction of justice.
He also appointed as special counsel the U.S. attorney who is conducting a criminal investigation into the origins of the FBI's probe of the 2016 election that morphed into Mueller's investigation of possible Trump-Russia cooperation, following Trump's repeated calls to "investigate the investigators."
Barr also ordered Justice Department prosecutors to review the handling of the federal investigation into Trump's former national security adviser Michael Flynn and then sought to dismiss the criminal charges against Flynn, who had twice pleaded guilty to lying to the FBI. Trump later pardoned Flynn.
Barr's break from Trump over election fraud wasn't the first. Earlier this year, Barr told ABC News that the president's tweets about Justice Department cases "make it impossible for me to do my job" and tensions flared just a few months ago when the two were increasingly at odds over the pace of the Durham investigation.
Trump had been increasingly critical about a lack of arrests and Barr was privately telling people he was frustrated by Trump's public pronouncements about the case.
Trump was also said to blame Barr for comments from FBI Director Chris Wray on election fraud and mail-in voting that didn't jibe with the president's alarmist rhetoric.
- AP