DENVER  Senator John McCain is giving up on his efforts to win the state of Michigan, his campaign said Thursday, in the latest sign that the faltering economy has reshaped the presidential race and cost Mr. McCain support in crucial states.

Ceding Michigan is a major blow to the McCain campaign, which had spent heavily on television commercials there and where Mr. McCain had campaigned repeatedly in the hopes that he could appeal to enough blue-collar voters, so-called Reagan Democrats and independent voters, to bring the state back into the Republican column in November.

But as the rippling financial crisis shook up the presidential election, and Mr. McCain’s somewhat unsteady response to it appeared to cost him support in a number of recent polls of battleground states, his campaign decided to pull out of Michigan and redirect its resources to other swing states where they felt Mr. McCain had a better chance.

The McCain campaign has spent nearly $8 million on ads in Michigan, according to the Campaign Media Analysis Group, a company that monitors political advertising, and now it has no more plans to advertise there, campaign officials said. And Mr. McCain canceled a visit he had planned to make to Michigan next week.