US President Barack Obama has declared that a decade of war is ending, the nation's economy is recovering and "America's possibilities are limitless".

Mr Obama made the comments in his inaugural address after being publicly sworn in for his second term as President of the United States.

An estimated 700,000 people attended the inauguration on Capitol Hill, down significantly from the record 1.8 million people who attended Mr Obama's first inauguration in 2009.

He had a formal swearing-in yesterday at the White House because of a constitutional requirement that the president take the oath on 20 January.

Today, he repeated the oath - led by Supreme Court Chief Justice John Roberts - at his largely symbolic public inauguration.

The president used his address to urge the country to join him in tackling a vast array of problems, from slowing climate change to honouring the dignity of men, women and children around the globe.

"My fellow Americans, we are made for this moment, and we will seize it, so long as we seize it together," Mr Obama said.

He also marked a new direction in foreign policy as the US prepares to pull troops from Afghanistan, ending the country's longest war.

"We, the people, still believe that enduring security and lasting peace do not require perpetual war," the president said.

He said the country must make hard choices to reduce the massive deficit.

"But we reject the belief that America must choose between caring for the generation that built this country and investing in the generation that will build its future," he said.

The president said every citizen deserves a basic measure of security and dignity, and he held up health care programmes and the Social Security pension programme as commitments that strengthen the US.

His wide-ranging speech touched on a variety of issues, including the Middle East democracy uprisings.

He made a relatively long reference to the need to address climate change, which he mostly failed to do in his first four years.

"We will respond to the threat of climate change, knowing that the failure to do so would betray our children and future generations," the president said.

On gay rights, Mr Obama insisted: "Our journey is not complete until our gay brothers and sisters are treated like anyone else under the law."

And in a nod to America's fast-growing Hispanic population that helped him secure re-election in November, he said there was a need to "find a better way to welcome the striving, hopeful immigrants who still see America as a land of opportunity".

He acknowledged the difficult road ahead even as he sought to build momentum from his November re-election victory.

Mr Obama opens his second term facing many of the same problems that dogged his first term: persistently high unemployment, crushing government debt and a deep partisan divide.