Barack Obama, the Illinois Democrat who built a campaign and a movement around the promise of change, won a resounding victory over Republican John McCain Tuesday night, becoming the first black president in U.S. history.

Choosing a steady 47-year-old lawyer and former community organizer to guide the nation, voters looked past Obama's relative lack of national experience to end eight years of Republican leadership amid a once-in-a-century economic crisis and protracted foreign wars.

Hundreds of thousands of supporters gathered in Grant Park in Chicago, which Obama represented in the Illinois Legislature just 46 months ago, as the Democrat was declared the winner about 11 p.m. Eastern time.

Obama said that his victory reaffirmed that America remains a place "where all things are possible."

"It's been a long time coming, but tonight, because of what we did on this date, in this election, at this defining moment, change has come to America," he said.

Celebrations erupted in New York, Washington, Baltimore, Atlanta and other cities.

The son of a mother from Kansas and a father from Kenya, Obama becomes the first U.S. senator to be elected president since John F. Kennedy in 1960. The 44th president will take office at a time of daunting challenges, amid an economic crisis that threatens to overwhelm his promises to spend on education, health care and energy.

To enact his programs, he will rely on a Congress with Democratic majorities that grew after Tuesday's voting. Democrats picked up at least five seats in the Senate and at least 14 in the House of Representatives.

Obama carried Ohio, Virginia, Colorado, Florida and New Mexico, states that went to President Bush four years ago, and won electoral vote-rich states that had been trending his way, including Pennsylvania and Minnesota.

In a year when voters seemed to crave a clean break from the Washington status quo, McCain, a former prisoner of war in Vietnam, never shook the burden of representing the party of Bush. Six of 10 voters in Maryland said a McCain administration would continue Bush's policies, and three in four said the country was on the wrong track, according to a Maryland exit poll.

McCain campaigned as a maverick willing to buck his party on campaign finance, immigration and tax cuts. But his three decades of experience in Washington -- he would have become the oldest man elected to a first term as president -- were never a sufficient asset in the contest.

"We have come to the end of a long journey. The American people have spoken, and they have spoken clearly," McCain said Tuesday night.

He credited Obama with "inspiring the hopes" of millions of Americans.

"This is an historic election, and I recognize the special significance it has for African-Americans and for the special pride that must be theirs tonight," McCain said in Phoenix.

Obama built a national advantage as the financial crisis unfolded in late September, with voters saying they perceived Obama as more responsive than his rival to the urgency of the housing collapse and credit crunch.

Marylanders voted for Obama by a margin of more than 2-to-1, delivering him, as expected, one of his strongest showings of the day.

Half the voters in Maryland said they were "excited" by the prospect of an Obama administration, compared with just one in 10 who expressed the same sentiment about McCain, according to the exit poll conducted by Edison Media Research for The Baltimore Sun and WYPR.

Sen. Benjamin L. Cardin, a Maryland Democrat, called Obama a "transformational leader." Gov. Martin O'Malley said: "It's nice to have our country back. It's been a really miserable eight years."

A Democratic administration in Washington, the governor said, could help the state on health care and other issues.