WASHINGTON  Senator John McCain’s chief advertising strategist, Mark McKinnon, announced Tuesday that he was resigning, following through on a vow he had made months ago not to work against the candidacy of Senator Barack Obama.

His resignation follows the departures of five other aides in recent days because work they have done outside the campaign  as lobbyists for corporations and foreign nations, and, in one case, as a strategist for an independent political group  had presented conflict of interest issues.

In telling the Cox News Service last June that he would not work against an Obama candidacy, Mr. McKinnon had said that Mr. Obama’s election to the presidency “would send a great message to the country and the world.” In that interview, Mr. McKinnon had said that he had policy differences with Mr. Obama, especially on Iraq, and that he believed Mr. McCain was best suited for the presidency because of his national security positions. But, he added, “I just don’t want to work against an Obama candidacy.”

Mr. McKinnon’s decision highlights challenges Mr. McCain may face in running against a man who will be the first black presidential candidate from a major American political party if he cinches the Democratic nomination.