Former FBI director James B. Comey speaks during a Senate Intelligence Committee hearing on June 8, 2017, in Washington. (Alex Brandon/AP)

James B. Comey, the former FBI director and a registered Republican most of his adult life, is trying out a new role: armchair strategist for the Democratic Party.

Days after urging voters to paint the country blue in the midterm elections this fall, Comey took to Twitter on Sunday to caution Democrats not to move too far to the left. His message was an apparent response to the expanding group of Democratic candidates defining themselves as “democratic socialists,” a label that seeks distance from authoritarian forms of government many Americans associate with socialism.

“Democrats, please, please don’t lose your minds and rush to the socialist left,” Comey tweeted. “This president and his Republican Party are counting on you to do exactly that. America’s great middle wants sensible, balanced, ethical leadership.”

His advice swiftly drew criticism from Democrats who blame Comey for tipping the scales in Trump’s favor. They charge the former FBI chief with applying different standards to the public release of information in the investigation into Hillary Clinton’s use of a private email server and the bureau’s probe of Russian meddling in the election.

“Last time you practiced politics it resulted in a fiasco of historic proportions,” wrote Ronald Klain, former chief of staff to Vice President Joe Biden and Vice President Al Gore. Tommy Vietor, former spokesman for President Barack Obama’s National Security Council, responded, “we got this covered. No one is asking for your advice. As we saw during the campaign, your judgment isn’t great! All the best, everyone.”

With Comey’s tweet, he inserted himself into a searching debate about the identity of the Democratic Party, as long-held assumptions about health care and border control, among other hot-button issues, are coming under question. Not just Alexandria Ocasio-Cortez, the 28-year-old former organizer for Sen. Bernie Sanders (I-Vt.) who recently toppled a stalwart of New York Democratic politics, but upstart candidates from Nebraska to Pennsylvania to Idaho to Oregon have tapped into far-left reservoirs of support. Over the weekend, Zak Ringelstein, a Democratic contender for Senate from Maine, became the first major-party Senate candidate to describe himself as a democratic socialist.

This phenomenon has worried those who see themselves as keepers of the political center.

Comey’s appeal echoed the one offered recently in the Wall Street Journal by Joseph I. Lieberman, a onetime Democrat and vice presidential nominee. Lieberman, who is now an independent, urged voters in New York’s 14th Congressional District to defy the results of the Democratic primary and vote for Rep. Joseph Crowley on the Working Families line of the ballot. (Crowley, the chairman of the House Democratic Caucus, has accepted defeat and is no longer campaigning.) Lieberman said Democrats will only succeed this fall with “sensible, mainstream candidates.” Many bristled at a defector from the party offering unsolicited advice on its direction.

But Comey was perhaps an even less-welcome messenger, given his controversial role in the 2016 election. Users found colorful language to describe their disinterest in Comey’s political views and personal distaste for him.

Some questioned his use of the label “socialist left” as a term of derision.

Mostly they found new occasion to deplore Comey’s role in the 2016 election.

Hillary Clinton herself has stated that she “would have won but for Jim Comey’s letter on Oct. 28,” referring to the letter that Comey addressed to Congress 11 days before the November election saying the FBI was investigating additional emails related to the Clinton case. Trump fired Comey in the spring of 2017, saying the FBI chief, who was overseeing an investigation into Russia’s interference in the election, had mishandled the email case. The president has since blasted Comey as an “untruthful slime ball” in response to scathing characterizations of the Trump presidency offered in Comey’s memoir.

In addition to his 304-page tell-all, Comey has taken to Twitter to vent his frustrations about American politics. He used to keep his identity secret on the social media platform, posting photos of nature and other anodyne messages under the name Reinhold Niebuhr, the Protestant theologian and political philosopher on whom Comey wrote his senior thesis as an undergraduate at William & Mary. But the former FBI director pulled back the curtain in the fall of last year. At first, he mostly stuck to piety and pop philosophy, sharing quotes from the Bible and from figures such as Martin Luther King Jr., and Winston Churchill.

He began using Twitter to weigh in on political issues at the end of last year, defending his former colleagues at the FBI and, sometimes, directing his messages squarely at the president.

Comey has addressed everything from the importance of facts — (“Dangerous time when our country is led by those who will lie about anything”) to the spectacle of the recent summit in Helsinki (“This was the day an American president stood on foreign soil next to a murderous lying thug and refused to back his own country”). He stoked rumors of possible political ambitions when he posted a photo of himself surveying an Iowa field. “So good to see new growth in Iowa and across the country,” he wrote.

And he still occasionally tweets photos of the great outdoors, taking a break from politics in February to post a shot of the Potomac.