He showed up unannounced and was initially not even invited, but he was prepared all the same.

Rudolph W. Giuliani, the former mayor of New York and one-time Republican presidential hopeful, stepped to the microphone at the “21” Club in Manhattan on Wednesday, for an event ostensibly spotlighting Gov. Scott Walker of Wisconsin. But by suggesting that President Obama did not love his country, Mr. Giuliani became the story.

His remarks, seemingly out of the blue, were not an isolated outburst.

No more than an hour or two before Mr. Giuliani appeared at Mr. Walker’s event, he vented his frustration at Mr. Obama at another fund-raising event in Manhattan. There, Mr. Giuliani took particular issue with the president’s recent comments likening Islamic extremist terrorism to the religious warfare of the medieval Crusades.

Only the previous week, Mr. Giuliani veered off topic at a realtors’ conference in Las Vegas to assail the president’s irresolute stance toward President Bashar al-Assad of Syria, attendees said. And on Feb. 13, he told an Iranian-American group in Arizona that Mr. Obama was not “a man who loves his people.” (In an online video of the event, Mr. Giuliani is shown shouting: “Mr. President, wake up. Come off the golf course.”)

Mr. Giuliani’s friends and political associates say he has become a man obsessed — horrified at what he views as a listless White House approach to terrorism and instability in the Middle East, and eager to say so.