Media playback is unsupported on your device Media caption President Obama: "Perhaps, the argument goes... the time for our leadership has passed. That argument is wrong"

President Obama has told British politicians that, despite the rise of new global powers, the time for US and European leadership "is now".

He said the influence of the US, UK and allies would remain "indispensable," in a speech in Parliament on the second day of his UK state visit.

But he said that leadership would need to "change with the times" to reflect economic and security challenges.

He is the first US president to address MPs and peers in Westminster Hall.

Rows of the UK's most senior politicians and other prominent figures lined the historic building to hear the US president talk about the history of the UK's relationship with the United States and its shared values - and outline some of the future challenges facing the world.

Former British prime ministers Sir John Major, Tony Blair and Gordon Brown sat next to each other in the packed hall - the oldest part of the Houses of Parliament - which fell silent as the US president began his 35-minute speech.

As he began, Mr Obama joked that with an "especially active press corps", the relationship between the UK and US was forever being "over analysed".

But he added: "There are few nations that stand firmer, speak louder and fight harder to defend democratic values around the world than the United States and the United Kingdom."

'New chapter'

He said the two countries had "arrived at a pivotal moment once more" following global recession and years of conflict.

Even as more nations take on the responsibilities of global leadership, our alliance will remain indispensable to the goal of a century that is more peaceful, more prosperous and more just Barack Obama 'No let up' on Gaddafi - ObamaObama UK speech in full, with analysis

With the winding down of operations in Iraq, progress in Afghanistan and having dealt "al-Qaeda a huge blow by killing its leader Osama Bin Laden", President Obama said it was time to enter a "new chapter in our shared history" with new challenges.

But he rejected arguments that the rise of superpowers like China and India meant the end for American and European influence in the world.

"Perhaps, the argument goes, these nations represent the future, and the time for our leadership has passed. That argument is wrong. The time for our leadership is now," he said.

"It was the United States, the United Kingdom, and our democratic allies that shaped a world in which new nations could emerge and individuals could thrive.

"And even as more nations take on the responsibilities of global leadership, our alliance will remain indispensable to the goal of a century that is more peaceful, more prosperous and more just."

But he added that leadership had to "change with the times" and the days were gone when an American president and UK prime minister could "sit in a room and solve the world's problems over a glass of brandy".

In his speech, Mr Obama also:

Acknowledged differences in the US and UK approach to deficit reduction but said their end goal was the same

Insisted the allies were preparing to "turn a corner" in Afghanistan - allowing Afghans to take the lead against the Taliban and stopping the country from becoming a haven for terrorists

Warned North Korea and Iran against flouting their obligations on nuclear weapons

Vowed to work for a resolution to long-running conflicts like that in Sudan, and in supporting a "secure Israel and a sovereign Palestine"

Defended action in Libya - saying the intervention had "stopped a massacre"

President Obama said the US and UK must invest in nations like Tunisia and Egypt which were making a transition to democracy, through trade and commerce, while "sanctioning those who pursue repression".

"We do this knowing that the West must overcome suspicion and mistrust among many in the Middle East and North Africa - a mistrust that is rooted in a difficult past," he said.

He acknowledged that the West had been accused of hypocrisy in its dealings with the region but said the West must acknowledge its interests while insisting it rejected "as false the choice between our interests and our ideals, between stability and democracy".

'Turning up heat'

He stressed the shared values of the US and UK - about the rights of the individual, regardless of race, and the rule of law.

No one could emerge from this state visit doubting America's influence; certainly not David Cameron who hitched a lift in the famous Presidential limousine Ross Hawkins, BBC Political Correspondent Analysis: Obama praise shows US influence

The speech was largely heard in silence, but there was some laughter at Mr Obama's jokes.

And he got a round of applause as he struck a more personal note, saying that the example of the US and UK had shown "that it's possible for the sons and daughters of former colonies to sit here as members of this great Parliament, and for the grandson of a Kenyan who served as a cook in the British Army to stand before you as president of the United States".

It took him more than 10 minutes to leave Westminster Hall as he stopped to shake hands with the ranks of politicians and other prominent figures who had lined the building to hear his speech.

Earlier questions about the strategy in Libya featured heavily during a press conference at Lancaster House.

UK Prime Minister David Cameron said there was no future for that country - which has seen two months of intense fighting between pro and anti-government forces - with Col Gaddafi in power, and said he and President Obama "agree we should be turning up the heat in Libya".

But while Mr Obama said there would be "no let-up in the pressure" on Libyan leader Col Gaddafi, he warned: "Ultimately this is going to be a slow, steady process in which we are able to wear down the regime forces."

Speaking on a personal note, Mr Cameron said he had come to know the president well over the past year and had come to "value his leadership and courage".

On Wednesday night, the Obamas are hosting a banquet for the Queen, the Duke of Edinburgh and a select group of other guests at the US ambassador's residence.