One of McCain’s senior strategists, Charles Black, said that the campaign had fared better in Pennsylvania than in any other blue state in recent months, and that Mr. McCain was a different candidate than President Bush, who waged a long and expensive battle here four years ago. “Bush came close here, but he did badly in the Philadelphia suburbs,” Mr. Black said, arguing that Mr. McCain’s old “maverick” label would have greater appeal in those suburbs, even though Mr. McCain has run a traditional Republican general election campaign.

Philadelphia is one of the only major cities in the country where Mr. McCain’s advertising campaign is anywhere near as voluminous as that of Mr. Obama’s. But even there, he lags nonetheless. On Tuesday, Mr. McCain effectively reduced his advertising campaigns in five other states  Colorado, Maine, Minnesota, New Hampshire and Wisconsin  in what Democrats suspected was an effort to divert resources to a more robust advertising effort here (though the savings from those moves had yet to show up in the state as of Tuesday night).

Mr. McCain’s advisers have contended that they do not expect white voters to reject Mr. Obama, of Illinois, simply because he is black. When Mike DuHaime, the campaign’s political director, was asked in a conference call with reporters on Tuesday what effect he thought race would play in Pennsylvania, he replied, “I hope there is none.”

Mr. DuHaime rejected comments made last week by a Pennsylvania Democrat, Representative John P. Murtha, who told The Pittsburgh Post-Gazette, speaking of his home base, that “there is no question that Western Pennsylvania is a racist area.”

Mr. McCain referenced Mr. Murtha’s comments in his third stop of the day, at Robert Morris University here, when he said, “I think you may have noticed that Senator Obama’s supporters have been saying some pretty nasty things about Western Pennsylvania lately.” As the crowd booed, Mr. McCain became tangled up in the rest of his remarks. “And you know, I couldn’t agree with them more,” he said, to silence, and then wandered around in a verbal thicket before finally managing to say, “I could not disagree with those critics more; this is a great part of America.”

Mr. Obama, who was in Florida on Tuesday, had no immediate plans to return to Pennsylvania in coming days, perhaps the most telling sign that his strategists were comfortable with his position there. But Democratic officials in the state said they had been urging the Obama campaign to send the senator back there at least once more before Election Day to shore up support.

An aggressive ground game for Mr. Obama, meanwhile, is under way in all corners of Pennsylvania, where hundreds of campaign workers and tens of thousands of volunteers were manning 80 field offices in what Democrats described as the largest organizational effort in state history.