WASHINGTON (AP) — Long regarded as having one of the shrewdest political minds among recent presidents, Bill Clinton has at times angered and alienated Democrats and Republicans alike while campaigning for his wife, Hillary Clinton.

His apparently spur-of-the moment decision to chat this week with Attorney General Loretta Lynch even as her agency is overseeing a sensitive investigation of his wife’s use of a private email server as secretary of state was only the latest in a series of loose-cannon episodes.

In 2008:

-In remarks that struck some as racial politics, Bill Clinton equated Barack Obama’s win in the South Carolina Democratic primary in January 2008 with Jesse Jackson’s victories in the state in 1984 and 1988. He touched off a furor about whether he was diminishing Obama’s achievement in a state where African-Americans make up a significant bloc of the Democratic electorate by citing past victories by another black candidate.

-Days before the New Hampshire primary, Bill Clinton infuriated some Democrats when he dismissed Obama’s opposition to the Iraq war. “Give me a break,” Clinton said. “This whole thing is the biggest fairy tale I’ve ever seen.” As a New York senator, Hillary Clinton voted to give President George W. Bush the authority to use military force, an issue that dogged her through the campaign.

In 2016:

-Contrasting his wife’s campaign with Sen. Bernie Sanders’, Bill Clinton ticked off Sanders supporters on Feb. 15 in Riviera Beach, Florida, by comparing them to GOP tea party activists. Both groups, Clinton said, were falling for unfulfillable promises. In the GOP, “they just tell people what they want to hear, move them to the right and we’ll be rewarded – except they didn’t get anything done,” he said, adding: “That’s going on now in our party.”

-Clinton urged voters in March in Spokane, Washington, to “put the awful legacy of the last eight years behind us.” He was apparently referring to Republican intransigence in Congress, but the line appeared to tar the Obama administration, too. He said people should vote for his wife “because she’s the only person who basically has good ideas.”

-Clinton sparred strenuously with Black Lives Matters protesters who interrupted his campaign speech in Philadelphia in April. He said, on one hand, that “black youth are not super predators,” a reference to his wife’s 1996 speech about violent crimes committed by young people. Yet, in defending his administration’s backing of a contentious federal crime bill that stiffened penalties, he also said his wife’s phrase was correct. “Maybe you thought they were good citizens,” he said. “She didn’t.”

-In May, in Kokomo, Indiana, he dismissed the flap over his wife’s use of a private email server as secretary of state as no more than “a game” – this, despite the FBI’s continuing criminal investigation of the matter.

“So everybody’s breathless about this,” he said. “Look, this is a game.”