Barack Obama announced plans to withdraw more troops from Afghanistan and take steps to boost the fragile US economy as he delivered a closely-watched State of the Union address today, laying out his priorities for the year ahead and his newly-begun second term in office.

The speech before a joint session of Congress' two chambers was dominated by domestic issues, as the president challenged deeply-divided politicians to find compromises that would boost job creation and strengthen America's middle class as he conceded America's economic revival was an "unfinished task".

His focus on jobs and growth underscored the degree to which he is still hampered by the economy, even as he pursues a bolder agenda including overhauling immigration laws, enacting stricter gun-control measures and tackling climate change.

Foreign policy received less attention, but took on greater urgency as the speech came hours after North Korea announced that it had detonated a nuclear device. Mr Obama said North Korean leaders "must know that they will only achieve security and prosperity by meeting their international obligations".

He said "provocations" like the test would further isolate North Korea "as we stand by our allies, strengthen our own missile defence, and lead the world in taking firm action in response to these threats".

Mr Obama also announced that the US would begin talks with the European Union on a trans-Atlantic trade agreement "because trade that is free and fair across the Atlantic supports millions of good-paying American jobs".

The annual address is one of the biggest events in Washington. It is broadcast during prime evening viewing hours by the major television networks, with Washington's most powerful officials - politicians, Supreme Court justices, military leaders and cabinet members - all in attendance and millions watching from home.

This year's speech came at one of the strongest points in Mr Obama's presidency. He won re-election by a convincing margin, is generally popular, and opposition Republicans appear weakened and fractured.

But Republicans control the House of Representatives and tough fights loom on the budget and other top issues.

With the economy still the biggest concern of most Americans, Mr Obama devoted less time to foreign policy this year. But his announcement on the withdrawal of 34,000 troops from Afghanistan - about half the force there - is a major development, even if it was highly anticipated.

It puts the United States on target to formally finish the protracted war by the end of 2014.

Mr Obama also pledged to work with Russia to seek further reductions in nuclear arsenals and to complete negotiations on the Trans-Pacific Partnership, a trade agreement with the Asia-Pacific region, in addition to pursuing the European agreement.

He also said the United States "will keep the pressure on a Syrian regime that has murdered its own people, and support opposition leaders that respect the rights of every Syrian".

Mr Obama used the address to press for action on climate change and for stricter gun control laws, both of which face resistance from House of Representatives Republicans.

On climate change, Mr Obama pledged to work to seek bi-partisan solutions but said if Congress did not act, he would order his cabinet to seek steps he can take using his presidential powers.

He said major storms, droughts and wildfires that have hit the United States could be considered "just a freak coincidence, or we can choose to believe in the overwhelming judgment of science - and act before it's too late".

His push for overhauling immigration laws had broader appeal - one of the few major issues on which badly-divided Republicans and Democrats can find common ground.

Republicans have long opposed relaxing immigration laws, but are reconsidering their positions as they try to appeal to Hispanics, a growing part of the US electorate that has overwhelmingly favoured Democrats.

One of the leading Republican voices for immigration reform, Senator Marco Rubio, was tapped to deliver the official Republican response. Mr Rubio, a 41-year-old Cuban-American, is one of the party's brightest stars and a possible 2016 presidential candidate.

But in a sign of the divisions in the party, another, unofficial Republican response will be given by Rand Paul, a senator who is a favourite of the small-government tea party movement.

Republicans remain united in their opposition to Mr Obama's proposals for more spending at a time of huge deficits. Mr Obama said his proposals to increase spending on manufacturing, infrastructure and clean-energy technologies would be fully paid for, though he did not specify how he would offset the cost of his proposals.

"Nothing I'm proposing tonight should increase our deficit by a single dime," he said.

He called for increased spending to fix roads and bridges, the first increase in the minimum wage in six years and expansion of early education to reach every four-year-old.

He is also calling on Congress to prevent another potential blow to the economy on March 1, when massive, automatic spending cuts are due to take place.

Mr Obama has asked politicians to block those cuts by approving a mix of tax increases and targeted budget cuts.

Republicans oppose any further tax increases beyond those they reluctantly agreed to on the wealthiest households at the start of the year, in exchange for extending tax cuts for the vast majority of Americans.

"He's gotten all the revenue he's going to get," the Senate's top Republican, Mitch McConnell, said before the speech.

While Mr Obama made his case for greater gun control, first lady Michelle Obama was sitting with the parents of a Chicago teenager shot dead just days after she had performed at the president's inauguration last month.