WASHINGTON - President Barack Obama urged Americans Tuesday night in to rekindle their belief in the promise of change that first carried him to the White House, declaring that the country must not allow election-year fear and division to put economic and security progress at risk.

"All the talk of America's economic decline is political hot air," Obama said. "So is all the rhetoric you hear about our enemies getting stronger and America getting weaker."

"The United States of America is the most powerful nation on Earth. Period. It's not even close," he said.

The president's address to both chambers of Congress and a prime-time television audience was meant to both shape his legacy and put his imprint squarely on the race to succeed him. He defended his record - and implicitly urged the public to elect another Democratic president to build on it - but acknowledged the persistent anxieties of Americans who feel shut out of a changing economy or at risk from an evolving terror threat.

Mindful of the scant prospect for major legislative action in an election year, Obama avoided the traditional litany of policy proposals found in State of the Union addresses in which presidents outline their agenda for the coming year.

While Obama did not directly call out Republicans, he sharply, and at times sarcastically, struck back at rivals who have challenged his economic and national security stewardship.

In his most pointed swipe at the Republican candidates running to succeed him, Obama warned against "voices urging us to fall back into tribes, to scapegoat fellow citizens who don't look like us or pray like us or vote like we do or share the same background."

His words were unexpectedly echoed by South Carolina Gov. Nikki Haley, who gave the Republican response to Obama's address. Haley called on Americans to resist the temptation "to follow the siren call of the angriest voices." She did not mention the Republican presidential race, but the campaign has featured heated rhetoric about immigrants and minorities from front-runner Donald Trump in particular that has unnerved some Republican leaders.

"No one who is willing to work hard, abide by our laws and love our traditions should ever feel unwelcome," said Haley, the daughter of Indian immigrants.

Focused on his own legacy, Obama ticked off a retrospective of his domestic and foreign policy actions in office, including helping lead the economy back from the brink of depression, taking aggressive action on climate change and ending a Cold War freeze with Cuba.

He touted implementation of the landmark nuclear deal with Iran, but made no mention of the 10 American sailors picked up by Iran Tuesday. The Pentagon said the sailors had drifted into Iranian waters after encountering mechanical problems and would be returned safely and promptly.

Tackling one of the most vexing foreign policy challenges of his presidency, Obama vowed a robust campaign to "take out" the Islamic State group, but chastised Republicans for "over the top claims" about the extremist group's power.

"Masses of fighters on the back of pickup trucks and twisted souls plotting in apartments or garages pose an enormous danger and must be stopped," he said. "But they do not threaten our national existence."

The president's words were unlikely to satisfy Republicans, as well as some Democrats, who say he underestimates the Islamic State's power and is leaving the U.S. vulnerable to attacks at home.

Obama was frank about one of his biggest regrets: failing to ease the persistently deep divisions between Democrats and Republicans. The Republican-controlled Congress that Obama stood before Tuesday night is hostile to his ideas and angry about his executive orders on issues from guns to immigration.

On the campaign trail, Trump's heated rhetoric is seen by some voters as a welcome contrast to Obama's cool calls for civility. On his Twitter account Tuesday night, the candidate dismissed Obama's speech as "really boring."

As for political disagreement, Obama conceded, "The rancour and suspicion between the parties has gotten worse instead of better. There's no doubt a president with the gifts of Lincoln or Roosevelt might have better bridged the divide, and I guarantee I'll keep trying to be better so long as I hold this office."

He specifically called for ending the practice of drawing up some congressional districts in a manner that gives parties an iron grip on House seats. He also urged steps to make voting easier and reduce the influence of money in politics.

Obama did reiterate his call for working with Republicans on criminal justice reform and finalizing an Asia-Pacific trade pact, and he also vowed to keep pushing for action on politically fraught issues such as curbing gun violence and fixing the nation's fractured immigration laws.

The president also touted a new effort led by Vice-President Joe Biden to fight cancer, aimed at increasing public and private resources and breaking down barriers to collaboration among researchers. Biden's 46-year-old son Beau died last year from brain cancer.

Yet Obama was eager to look beyond his own presidency, casting the actions he's taken as a springboard for future economic progress and national security. His optimism was meant to draw a contrast with what the White House sees as doom-and-gloom scenarios peddled by Republicans.

Republicans were largely dismissive of the president's address. House Speaker Paul Ryan, assuming the speaker's traditional seat behind the president for the first time, said Obama's "lofty platitudes and nostalgic rhetoric may make for nice soundbites, but they don't explain how to" solve problems.

The president himself appeared to get momentarily caught up in the emotion of the moment. As he walked toward the exit after his hour-long speech, he turned back to the crowded House chamber and said, "Let me take one more look at this thing."

-----

AP writers Josh Lederman, Nancy Benac and Donna Cassata contributed to this report.