Barack Obama used his second-term inaugural address to issue a powerful call to action, as he embraced an unashamedly liberal agenda and urged Americans to reclaim from conservatives the spirit of the founding fathers.

Speaking in front of Congress after renewing his presidential oath of office before a crowd of about half a million, the 44th US president pledged that he would battle against poverty and prejudice, deliver equality for gay people, tackle climate change and give young undocumented immigrants a path to citizenship.

Conscious that so many second terms end in failure and disappointment, he held out the prospect of bucking history. "America's possibilities are limitless … My fellow Americans, we are made for this moment, and we will seize it so long as we seize it together," Obama said.

His speech was steeped in the language of the US constitution and in rhetorical references to Martin Luther King, underlining the symbolism of the inauguration taking place on the national holiday that celebrates the civil rights leader.

As a result it was more inspirational than the largely disappointing address in 2009. Then, faced with unrealistic hopes for his presidency and with the country caught up in he worst economic crisis since the 1930s, he had to dampen expectations.

This time round, he took the opposite approach, making a case for collectivism, the need for the federal government to help individuals out of poverty, offering opportunities for all rather than just a shrinking privileged few.

Attempting to debunk the rightwing interpretation of the constitution that has held sway in the US, Obama, in what became a near constant refrain throughout his speech, said the founding fathers did not intend the country to become enslaved by the constitution and that patriotism was not the preserve of the right.

"That is our generation's task – to make these words, these rights, these values – of life, and liberty, and the pursuit of happiness – real for every American. Being true to our founding documents does not require us to agree on every contour of life; it does not mean we will all define liberty in exactly the same way, or follow the same precise path to happiness.," Obama said.

It was down to the current generation to make the principles a reality, he declared. "For history tells us that while these truths may be self-evident, they have never been self-executing."

One of the most striking passages was in support of gay rights. Obama, early in his first term, was heavily criticised by gay organisations for failing to do enough. He partly redeemed himself through support for gays in the military and for equal marriage rights, but he went further on Tuesday, placing the battle for gay rights, summed up by the Stonewall protests in New York, alongside other key civil right fights.

"We, the people, declare today that the most evident of truths – that all of us are created equal – is the star that guides us still; just as it guided our forebears through Seneca Falls, and Selma, and Stonewall," Obama said.

"Just as it guided all those men and women, sung and unsung, who left footprints along this great Mall, to hear a preacher say that we cannot walk alone; to hear a King proclaim that our individual freedom is inextricably bound to the freedom of every soul on earth."

"Our journey is not complete until our gay brothers and sisters are treated like anyone else under the law," he said.

And he explicitly embraced gay marriage rights. ""If we are truly created equal, then surely the love we commit to one another must be equal as well," he said.

Obama made similar pleas for equal pay for women, for legislation to provide a path to citizenship for undocumented immigrants and against other vestiges of prejudice.

Obama was more forceful about climate change than at any point since becoming president, adding it to his second-term agenda. "Some may still deny the overwhelming judgment of science, but none can avoid the devastating impact of raging fires, and crippling drought, and more powerful storms," Obama said. "The path towards sustainable energy sources will be long and sometimes difficult. But America cannot resist this transition; we must lead it."

It was a day laden with historical references. He swore the oath on two bibles belonging to two of the most revered figures in American history, Dr King and Abraham Lincoln.

Adding to the poignancy, Myrlie Evers-Williams, the widow of Medgar Evers, the Mississippi civil rights leader shot dead by a white supremacist 50 years ago, delivered the invocation and recalled the ghosts of the civil rights era. She spoke of "witnesses unseen by the naked eye, but all around us, thankful that their living was not in vain." Obama acknowledged the debt.

The crowd, shouting "Obama, Obama" as he began his speech, was much smaller than the 1.8 million that turned out in 2009, mainly because second terms do not attract the same sense of history.

The mood in the crowd was more subdued than last time but retained a party spirit, and Obama too seemed more relaxed, more confident, with the mandate of a second election victory.

After the ceremony ended, with Beyoncé singing the national anthem, Obama returned briefly to the podium to look out across the crowd. His wistful comment was caught on an microphone. He said he had come out because "I will never see this again."

Republicans temporarily suspended hostilities for the day, with House speaker John Boehner joining Obama for coffee earlier in the day and joining the party on the podium as he delivered the speech.

In contrast with his inauguration in 2009 when Obama expressed hope of working with Republicans, he appeared to have given up on bipartisanship, ready to confront Republicans rather than engage in the kind of fruitless attempts at conciliation that dominated his first term.

"For now decisions are upon us, and we cannot afford delay. We cannot mistake absolutism for principle, or substitute spectacle for politics, or treat name-calling as reasoned debate," Obama said. "We must act; we must act knowing that our work will be imperfect."

• This article was amended on 21 January 2013. The original referred to Barack Obama as the 45th president of the United States. This has been corrected