WASHINGTON — President Trump, in his first address to a joint session of Congress, defended his tumultuous presidency on Tuesday and said he was eager to reach across party lines and put aside “trivial fights” to help ordinary Americans.

He called on Congress to work with him on overhauling health care, changing the tax code and rebuilding the nation’s infrastructure and military.

But he raised new questions about his policy priorities and how he plans to achieve them, especially on immigration.

Only hours before his address, Mr. Trump had broken from his tough immigration stance in remarks at the White House, suggesting that legal status be granted to millions of undocumented immigrants who have not committed serious crimes. Many of Mr. Trump’s core supporters had denounced that approach as “amnesty” during the campaign.

Video

President Trump emphasized the need for increased vetting of immigrants, a constant theme throughout his campaign.CreditCreditDoug Mills/The New York Times

But in his speech, Mr. Trump never mentioned legalizing undocumented people and over all held to the tough-on-immigration theme of his campaign.

“The time is right for an immigration bill as long as there is compromise on both sides,” the president said at the White House, according to people in attendance who asked for anonymity because they were not authorized to speak about the meeting.

The idea is a sharp break from the crackdown on immigrants in the United States illegally that Mr. Trump ordered in his first weeks in office and the hard-line positions embraced by his core supporters that helped sweep him into the White House.

But Mr. Trump made only a glancing reference to an immigration overhaul in his speech, calling for a new “merit-based” system that would admit only those able to support themselves financially. Over all he took a hard line on immigration, much as he had during the campaign.

“As we speak, we are removing gang members, drug dealers and criminals that threaten our communities and prey on our citizens,” Mr. Trump said. “Bad ones are going out as I speak tonight and as I have promised.”

But in contrast with the dark themes of his inaugural address, Mr. Trump’s speech to Congress was a more optimistic vision of America and what he called the promises ahead. The themes were largely Republican orthodoxy, delivered soberly and almost verbatim from a prepared text. Mr. Trump read from Teleprompters and appeared restrained and serious.

Republicans interrupted dozens of times with standing ovations, although Democrats mostly sat stone-faced. Mr. Trump presented himself as eager to put aside some of the vitriol of his presidency.

“The time for small thinking is over, the time for trivial fights is behind us,” he said. “From now on, America will be empowered by our aspirations, not burdened by our fears.”

The most emotional moment of the speech came when Mr. Trump recognized Carryn Owens, the widow of William Ryan Owens, a member of a Navy SEAL team who was killed during a commando raid that the president authorized in Yemen. Ms. Owens sobbed as Mr. Trump said, “Ryan’s legacy is etched into eternity.”

Mr. Trump said that Defense Secretary Jim Mattis had guaranteed him that it was a “highly successful raid that generated large amounts of vital intelligence.” Mr. Trump has been criticized for the raid, including by Mr. Owens’s father, with some arguing the operation was botched. Earlier in the day, Mr. Trump had blamed Mr. Owens’s death on “the generals” who oversaw the mission.

Although Mr. Trump’s presidency has been defined by executive orders and pronouncements, his speech appeared to be an attempt to open a new phase and reflected his need for cooperation from Congress.

“My administration wants to work with members in both parties to make child care accessible and affordable, to help ensure new parents have paid family leave, to invest in women’s health, and to promote clean air and clean water and rebuild our military infrastructure,” Mr. Trump said.

The president has yet to propose major legislation to achieve his goals, with members of his cabinet and senior staff members divided over key elements of tax and health plans, and congressional Republicans split on how to structure them. By this point in his presidency, Mr. Obama had established an active — if not always friendly — working relationship with a Democratic Congress, having signed into law a $787 billion package of spending and tax cuts intended to stabilize the economy.

Mr. Trump laid out the broad outlines of a health care overhaul that papered over divisions among Republicans about how to structure it, calling for a plan that uses tax credits and tax-advantaged savings accounts to help Americans buy insurance, and promising a “stable transition” from the existing system.

Yet he made no mention of an array of challenges abroad, including Syria, North Korea and Russia. Nor did Mr. Trump criticize one of his favorite foils, the “fake news” media. He did pledge his full support for NATO after questioning the need for the alliance, and argued that his demands that nations contribute more money to NATO had paid off.

“I can tell you that the money is pouring in,” Mr. Trump said without providing examples or specifics. “Very nice.”

Similarly, Mr. Trump offered no specifics on his suggestion earlier in the day that he might seek a comprehensive immigration overhaul. Such a move would be a significant turnaround for Mr. Trump, whose campaign rallies rang with shouts of “build the wall!” on the Mexican border. In January, he signed an executive order directing the deportation of any unauthorized immigrant who has committed a crime or falsified a document. The standard could apply to virtually any of the estimated 11 million people in the country illegally.

In his comments to the television anchors at the White House, Mr. Trump went so far as to raise the idea of granting citizenship to young undocumented immigrants who had been brought to the United States as children, one person present said. Such a change would go well beyond the temporary work permits President Barack Obama offered them through a 2012 executive order.

During his campaign, Mr. Trump criticized Mr. Obama’s directive as an “illegal amnesty,” and promised to immediately end the program if elected. But he has delayed acting on the matter since taking office and expressed sympathy for its beneficiaries, sometimes known as Dreamers.

The White House did not dispute Mr. Trump’s remarks to the anchors, but Sarah Huckabee Sanders, the deputy press secretary, said she had not witnessed the conversation and was therefore unable to confirm it.

Video

President Trump spoke before a joint session of Congress.CreditCreditDoug Mills/The New York Times

“The president has been very clear in his process that the immigration system is broken and needs massive reform, and he’s made clear that he’s open to having conversations about that moving forward,” Ms. Sanders said. “Right now, his primary focus, as he has made over and over again, is border control and security at the border and deporting criminals from our country, and keeping our country safe, and those priorities have not changed.”

The president’s remarks about immigration came as he prepares to issue a new version of his executive order banning travel to the United States from seven predominantly Muslim countries and suspending the acceptance of refugees. The ban has been revised because of legal challenges.

Mr. Trump defended that order in his address to Congress.

“It is not compassionate, but reckless, to allow uncontrolled entry from places where proper vetting cannot occur,” Mr. Trump said. “Those given the high honor of admission to the United States should support this country and love its people and its values. We cannot allow a beachhead of terrorism to form inside America — we cannot allow our nation to become a sanctuary for extremists.”

The speech reflected the war Mr. Trump is fighting with himself and his inner circle. Even as he held out the possibility of legal status for millions of undocumented immigrants, Melania Trump, the first lady, was hosting the families of victims of violent crime by such immigrants — a way of highlighting the president’s belief that immigrants who lack legal status pose a grave threat to Americans and should be feared and removed, not embraced.

Mr. Trump singled out the victims’ families, saying, “Your loved ones will never be forgotten.”

Giving the official Democratic response, former Gov. Steven L. Beshear of Kentucky offered an implicit contrast to the president by noting his own humble background and military service, accusing Mr. Trump and his “cabinet of billionaires and Wall Street insiders” of favoring banks and the wealthy over ordinary people.

“You and your Republican allies in Congress seem determined to rip affordable health care away from millions of people who most need it,” Mr. Beshear said. “This isn’t a game. It’s life and death for people.”

For Mr. Trump’s speech, the president turned to the top advisers who helped develop his inaugural address: Stephen Miller, his senior policy adviser, and Stephen K. Bannon, his chief strategist. The two were still working on the speech late Monday, aides said.

A version of this article appears in print on , Section A, Page 1 of the New York edition with the headline: Before Congress, Trump Urges End to ‘Trivial Fights’. Order Reprints | Today’s Paper | Subscribe