Massachusetts Senator John Kerry has formally announced his candidacy for president and said he will challenge President Bush's record on national security, foreign policy, and the economy.

Senator Kerry made his announcement in front of a decommissioned aircraft carrier in Charleston, South Carolina, surrounded by crew members from the naval gunboat he commanded during the Vietnam War.

The Massachusetts Democrat is hoping his military background will set him apart from the rest of the Democratic field and will make him a more credible critic of the president's record on national security and foreign policy issues.

"We will defend our national security and maintain a military that is the strongest armed force on earth," he said. "But if I am president, I will never forget that even a nation as powerful as the United States of America needs to make some friends in this world and I will do that."

Senator Kerry supported the congressional resolution last year authorizing the president to use military force in Iraq. But he has criticized the administration for rushing to war, adding that the president failed to build an international coalition on Iraq and has no plan to win the peace.

Like the other Democrats running for president, Senator Kerry will also campaign on the economy, which opinion polls indicate is a weak point for Mr. Bush.

Senator Kerry says the loss of three million jobs during the past three years is "an astonishing failure." He also says that, if elected, he would repeal the Bush tax cuts for the wealthy, but would retain those targeting middle-income Americans. "I reject George Bush's radical new vision of a government that comforts the comfortable at the expense of ordinary Americans," added Mr. Kerry.

Bush administration officials say the president will not be distracted by the criticisms from Senator Kerry or any of the other Democratic candidates. "The president remains focused on our nation's highest priorities, winning the war on terrorism abroad and creating jobs at home," said presidential spokesman Scott McClellan.

Senator Kerry was seen by many inside the Democratic Party as an early front-runner for the presidential nomination next year. But he has been eclipsed during the past several months by former Vermont governor Howard Dean, who has tapped into Democratic Party anger over the president and has made effective use of the Internet to mobilize supporters and raise money.

A recent poll in the early primary state of New Hampshire showed Howard Dean with a sizable lead over John Kerry, a turnaround from earlier in the year when Mr. Kerry had a comfortable lead.

With the primaries only about four months away, the Democratic race is expected to heat up in the weeks ahead, beginning with a debate featuring all nine contenders Thursday in New Mexico.