“I will miss him in Congress & value his friendship,” the senator concluded.

Many Twitter followers of Mr. Schumer, the highest-ranking Democrat in the Senate, did not agree with the sentiments.

“Good grief,” read one of the more polite responses. “Have you lost your mind?”

Indeed, the tweet prompted more than 10,000 replies, mostly negative and some downright nasty. Videos of thumbs-downs, eye-rolling and heads shaking “no,” flooded into Mr. Schumer’s feed, as the word “resign” got tossed about.

Many of those outraged by Mr. Schumer’s praise pointed out Mr. King’s more controversial positions and statements, including when he said that there are “too many mosques” in America; that protesting N.F.L. players are similar to Nazis; and that Eric Garner’s death was the result of his obesity and asthma, rather than the chokehold applied by a New York Police Department officer.

Add in Mr. King’s frequent support for President Trump and his policies, and Mr. Schumer’s comments seemed even more galling — and divisive — to some on the left.

Another of Mr. King’s congressional colleagues, Representative Ilhan Omar of Minnesota — a Muslim-American who herself has been the subject of Twitter fury — had a blunter take on his retirement announcement, noting his inflammatory statements about Islam and Mr. Garner.