Bringing a message that America's power and wealth should be used to serve humanity, the Argentine pontiff said the United States must not turn its back on "the stranger in our midst."
"Building a nation calls us to recognize that we must constantly relate to others, rejecting a mindset of hostility," the 78-year-old Francis told the Republican-dominated legislature.
Francis, born to an Italian immigrant family in Argentina, delivered a wide-ranging speech that addressed issues dear to liberals in the United States but also emphasized conservative values and Catholic teachings on the family.
The leader of the world's 1.2 billion Catholics called for a more equitable economy, greater effort against climate change, and an end to the death penalty globally.
His plea on immigration received frequent applause mostly from Democrats but also from Republicans among the lawmakers, Supreme Court justices and other dignitaries packed into the House of Representatives to hear the first address by a pope to the US Congress.
Harsh rhetoric toward illegal immigrants has featured heavily in the race for the Republican nomination for the November 2016 presidential election.
Republican front-runner Donald Trump says he would deport the 11 million undocumented immigrants if he were elected to the White House and has accused Mexico of sending rapists and other criminals across the border.
Himself a Latin American, Francis was speaking out on an issue that has cost the Republicans support among increasingly influential Hispanic voters.
He said America should not be put off by the number of foreigners, especially from south of the border, who are trying to make it their home.
"We must not be taken aback by their numbers, but rather view them as persons, seeing their faces and listening to their stories, trying to respond as best we can to their situation. To respond in a way which is always humane, just and fraternal," he said, speaking softly and in heavily accented English.
As he spoke, Francis was flanked by two of America's most influential Catholics: House Speaker John Boehner, a Republican, and Democratic Vice President Joe Biden. Boehner, who often tears up at emotional moments, cried openly during the speech.
Several Republican presidential candidates were in the audience, including retired neurologist Ben Carson, New Jersey Governor Chris Christie and Senator Marco Rubio, son of Cuban immigrants.
The United States has grappled for years over what to do with 11 million or so undocumented immigrants, most of them Hispanic.
Republicans in Congress last year blocked a bipartisan effort to overhaul immigration laws that would have allowed illegal immigrants a chance to win US citizenship.
Reuters/Ipsos polling this week shows that 30.5 percent of Americans think the Republican Party has the best approach to immigration while 29.7 percent believe the Democrats have the best plan. Twenty-two percent said they do not know.
Crowds of adoring fans greeted Francis on the streets of Washington and polls show he is popular among Catholics and non-Catholics alike.
But it is unclear if his speech will change hearts and minds on immigration.
"It doesn't affect my thoughts," said Michael Tipsword, a student at George Washington University and a Catholic. He said Francis' opinion on immigration is more related to humanitarian needs than politics.
"I'm a pretty staunch conservative," said Tipsword, standing on the lawn in front of the Capitol building where thousands watched the speech on a large video screen.
Invoking famous American political figures Abraham Lincoln and Rev. Martin Luther King Jr., Francis told US lawmakers who are often caught up in bitter partisan fights that politics should be "an expression of our compelling need to live as one, in order to build as one the greatest common good."
Presidential candidates from both sides of the divide held up the pope's comments as evidence that the leader of America's 70 million Catholics agrees with them.
In remarks welcomed by conservatives, Francis said, "Fundamental relationships are being called into question, as is the very basis of marriage and the family," expressing his opposition to same-sex marriage.
In reference to abortion and euthanasia, the pope said humanity must "protect and defend human life at every stage of its development."
Texas Republican Senator Ted Cruz, a 2016 White House hopeful, took a dig at Democratic rivals in Congress.
"It was striking and heartbreaking to see so many congressional Democrats sitting, stone-faced, arms crossed, when the pope urged us all to defend human life," he said.
A frequent critic of the damage caused to the environment by capitalism's excesses, the pope reiterated remarks he made at the White House on Wednesday, that the United States has an important role to play to "avert the most serious effects of the environmental deterioration caused by human activity."
To underscore his message of helping the poor, Francis went straight from Congress in his small black Fiat to have lunch with homeless people, telling them there was no justification for homelessness.
Later on Thursday, the pope flies to New York, where he will attend prayer services at St. Patrick’s Cathedral. Francis will address the United Nations General Assembly on Friday and celebrate an open-air Mass in Philadelphia on Sunday.