Former president Bill Clinton spoke with Attorney General Loretta Lynch during an impromptu meeting in Phoenix. (Don Ryan/AP)

Bill Clinton has made a mess. It was either out of foolish indifference or plain foolishness, but it has created a terrible moment for his wife and the Democrats, and for President Obama and perceptions of the integrity of his administration.

Clinton’s private, unplanned meeting with Attorney General Loretta E. Lynch at the Phoenix airport last week, coming at a time when the Justice Department should be nearing completion of its examination of Hillary Clinton’s use of a private server for her emails as secretary of state, will inevitably — and negatively — affect public attitudes about that investigation.

For a politician long praised for his political smarts, it was a striking error of judgment on Clinton’s part to walk to Lynch’s plane for any kind of conversation. It was a similarly huge lapse on the part of the attorney general, who was appointed by Clinton as a U.S. attorney in 1999, to allow him to come aboard for any kind of conversation.

Lynch has tried to make amends, though not without leaving some confusion in her wake. In a conversation Friday with Washington Post editorial writer Jonathan Capehart at the Aspen Ideas Festival, she insisted again that the conversation was innocent — about grandchildren and golf and such — and did not touch on the investigation of the emails.

But she said she recognized that others would not see it that way. “The fact that the meeting that I had is now casting a shadow over how people are going to view that work is something that I take seriously, and deeply and painfully,” she said.

Lynch said that she would “be accepting” whatever recommendation the career prosecutors and FBI Director James B. Comey bring her — though she did not say she would remove herself completely from the case. She also said she had made that decision some months ago but was only now making it public. If she sticks to her pledge simply to accept what is recommended without any genuine review and consideration, she is abdicating her role as attorney general.

Bill Clinton has been silent about the meeting and its propriety. He has made no public comment, and an adviser said Friday that he has no plans to do so. Until Saturday, Hillary Clinton had nothing to say about the propriety of the meeting. After being interviewed by the FBI, she told NBC’s Chuck Todd that the meeting between her husband and Lynch was innocent, adding, “Hindsight is 20/20.” The earlier silence on the part of the presumptive Democratic nominee is part of a pattern of declining to answer questions about the email issue until pushed by events to be more transparent.

Let’s assume that Lynch’s description of the meeting is wholly accurate — that this was a casual encounter between two people who have known each other for some time and who happened by circumstance to be on the same airport tarmac at the same time. Will that lessen suspicions that there is a coziness between the Clintons and the people in the Obama administration who have overall responsibility to be fair and fearless in the investigation? Hardly.

The meeting has provided fodder for Donald Trump and Republican leaders to cast doubt on whatever conclusions the career prosecutors and Comey come to. Trump called it “so horrible” and said he was “flabbergasted” by the reports of it. On Friday, he questioned the description of the conversation that took place.

“I love my grandchildren so much,” he said at the Western Conservative Summit in Denver, “but if I talk about them for more than nine or 10 seconds . . . after that, what are you going to say?” He also said, “I love golf, but after speaking about golf for a couple minutes, it’s tough.”

Trump’s campaign advisers long have seen the investigation as a win-win politically: Either Clinton is indicted and a major political crisis occurs for the Democrats or, if there is no case brought, the whole exercise was a whitewash. He can argue it round or square. If there is to be no charge against Clinton, Trump will point to the Lynch-Clinton meeting to question the integrity of the Justice Department’s decision. He has been handed a gift, and the Republican base is likely to respond with even greater indignation if no penalty is sought.

Trump’s effort to exploit the investigation for political gain is predictable and therefore discounted by Democratic allies of candidate Clinton. But that does not lessen the dismay among Democrats about what took place and why the former president would play into the hands of the Republicans so easily.

Senior administration officials have consistently tried to project a hands-off attitude about the investigation. White House press secretary Josh Earnest told reporters at the Friday briefing that the president “believes this matter should be handled without regard to politics.” He added, “This is an independent investigation that is deliberately being shielded from any political interference.”

But this is anything but a routine matter, and there is a difference between political interference and a case involving politics. This is a case with dramatic political ramifications, as everyone knows. The outcome could reshape the presidential campaign.

Lynch isn’t the only one whose actions raise questions. Think of this: The president has endorsed and is actively campaigning for Clinton at a time when his Justice Department is in the process of deciding whether she should be prosecuted. Although that has drawn little comment, it shocks some who have been in senior positions in previous governments and who believe that no White House can be truly indifferent or disinterested in such an important case.

Obama has made mistakes on this before. He seemingly sided with Clinton earlier, saying she was careless but that he didn’t think she had intentionally put national security in jeopardy. Does the fact of his endorsement mean that he thinks, as do any number of legal experts, that she will be in some way exonerated by the Justice Department?

Finally there is the question of when the investigation will end and the findings made public. The prosecutors are trying to be careful and thorough, which is laudable. But a clock is ticking. The Democrats are now weeks away from presumably nominating Clinton for president. The longer the investigation goes, the more any decision has major political effects.

Hillary Clinton wants and needs a clean resolution of the long investigation. Bill Clinton and the attorney general managed to muddy all this with their private chat in Phoenix, no doubt to the consternation of both Hillary Clinton’s campaign and the Justice Department officials trying to bring this to a resolution soon. No one looks good in this transaction.