Republican members of Congress congratulated one another and President Trump for passing the House GOP's tax bill on Nov. 16. Before the bill can go to President Trump's desk, the Senate and the House must pass the same bill. (Jenny Starrs/The Washington Post)

House Republicans on Thursday passed legislation that would overhaul the U.S. tax code, a crucial step forward in their effort to enact the centerpiece of President Trump’s economic agenda.

The bill passed with 227 votes in favor and 205 against, a comfortable margin in the divided chamber. Thirteen Republicans voted against the bill, while no Democrats voted for it.

Trump and Republican leaders in Congress are aiming to pass legislation by year’s end that would simplify the code and deliver $1.5 trillion in tax cuts over a decade. Both the House and Senate bills deliver the majority of the cuts to corporations and wealthy Americans, but there are significant differences between the bills that would have to be resolved.

Passing the bill is a major victory for House leaders, including Speaker Paul D. Ryan (R-Wis.), who have long asserted that cutting taxes on the wealthy and businesses will spur economic growth that benefits all Americans.

Trump visited House Republicans personally Thursday to urge support for the bill, leaving them, according to multiple people at the closed-door meeting, with a concise closing message: “I love you. Now go vote.”

House Speaker Paul D. Ryan (R-Wis.) points to boxes of petitions supporting the Republican tax bill as he arrives for a news conference on Capitol Hill on Nov. 14. (J. Scott Applewhite/AP)

The party’s tax plan faces an uncertain future in the Senate, where Republican leaders, working with a slimmer majority than in the House, are struggling to find enough support for their bill.

Multiple Republicans have expressed reservations about the Senate plan, which would permanently reduce the corporate tax rate but allow cuts for households and individuals to expire. The plan would also repeal the Affordable Care Act’s individual mandate to purchase health insurance, a difference from the House plan that gives Senate leaders more revenue to work with but would undermine a system aimed at providing health coverage to millions of Americans.

Congress’s nonpartisan tax analysts dealt the Senate an additional setback Thursday when they concluded the bill would, by the end of a decade, raise the average tax burden for households making less than $75,000 a year. Much of the hit to poor and working-class Americans would stem from the changes to the health-care law, as many would no longer get subsidies to help them afford health insurance because they would give up on buying it altogether, according to the Joint Committee on Taxation.

If the Senate is able to pass a tax bill, Republicans would have to reconcile their two versions, a complicated task because each bill contains compromises that leaders added to shore up support in their own chamber that would pose problems in the other.

The Senate bill would eliminate Americans’ ability to deduct taxes they pay to state and local governments from their federal tax bills, a critical provision for people in high-tax states such as New Jersey, New York and California. The House bill passed after leaders negotiated a compromise on the issue, eliminating most breaks for many state and local payments but allowing Americans to deduct up to $10,000 in property taxes. Many GOP members from districts in high-tax states voted for the bill Thursday after initially threatening to oppose it over the state and local issue.

Both the Senate’s expiring tax cuts for individuals and the elimination of the Affordable Care Act’s mandate were included to reduce the bill’s contributions to the national debt. Republicans say they expect the tax cuts for individuals to be extended in future legislation, but the gap between the measure’s treatment of corporations and individuals has given moderates pause in both chambers.

Senate Republicans released their tax proposal on Nov. 9, but face some hurdles to reconcile the differences among the Senate, the House and President Trump in order to sign a bill into law. (Jenny Starrs,Jordan Frasier/The Washington Post)

Republicans hope to pass the measure with 50 votes, rather than the 60 votes typically needed to get bills through the Senate, by using a Senate procedure known as “reconciliation.” But the rules of reconciliation limit the bill’s addition to the debt at $1.5 trillion over a decade and no more additions in years beyond that.

Republicans control only 52 of the chamber’s 100 seats, and Democrats’ opposition appears unanimous, meaning the bill would probably go down to defeat if only three GOP senators vote against it.

Sen. Ron Johnson (R-Wis.), a conservative whose vote leaders were counting on, said Wednesday he opposed the measure because it favored corporations over small businesses, although he left open the possibility of supporting an amended measure.

And Sen. Susan Collins (R-Maine) this week reiterated her stance that it’s “a mistake” to attempt to alter the health-care law as part of the tax effort.

Several other GOP senators, including Bob Corker (Tenn.), John McCain (Ariz.) and Lisa Murkowski (Alaska), have yet to declare their support for the bill.

The Senate Finance Committee, after a multiday meeting, approved the bill late Thursday, and Majority Leader Mitch McConnell (R-Ky.) said he would begin floor consideration after the Thanksgiving holiday. The final version could still change drastically as leaders work to address members’ concerns.

But House Republicans on Thursday largely set aside any concerns about how their Senate counterparts were handling the legislation. GOP lawmakers erupted in cheers on the House floor when the bill gained enough votes to pass, reflecting a sense of relief that a major campaign promise might be fulfilled after months of failure on health care.

“Passing this bill is the single biggest thing we can do to grow the economy, restore opportunity, and help these middle-income families who are struggling,” Ryan said before the vote. “This is something that’s going to refresh our confidence in ourselves and our confidence in each other.”

According to several members and aides present while Trump met with lawmakers, the president was unusually happy and freewheeling as he watched one of his legislative priorities proceed as planned, a departure from the party’s contentious and ultimately failed attempts to repeal the Affordable Care Act earlier this year.

Trump thanked party leaders, expressed optimism about the Senate bill, and said he believed that Congress ought to move to “welfare reform” after completing the tax bill, according to several members in the room. He also discussed his trip to Asia, including his efforts to free several UCLA basketball players accused of shoplifting in China, said the members, who spoke on the condition of anonymity because they were not authorized to speak about the private meeting.

Even before the vote, GOP leaders were confident that the pep talk wasn’t necessary. Fewer than a dozen of the 240 House Republicans had indicated they were opposing the bill. The GOP could have lost up to 22 votes and still passed the bill.

“It’s in our DNA to do this,” said Rep. Richard Hudson (R-N.C.), explaining why the tax bill has not been as internally divisive as the health-care push. “We may fight over the details vigorously, but end of the day, we’re going to deliver tax reform.”

Democrats, meanwhile, decried the plan as a giveaway to the wealthy that was written on a false premise.

House Minority Leader Nancy Pelosi (D-Calif.) said most Americans would get a “raw deal” under the GOP bill. “This tax scam won’t create jobs. It won’t raise wages. . . . It will only fill the coffers of donors and the fat cats,” Pelosi said, addressing Republicans on the floor: “You know why you’re here. You know what you’re doing.”

Of the 13 Republicans who broke with their colleagues to oppose the bill, most did so because they believed it would actually raise taxes on many of their constituents because of the elimination of many popular existing deductions and credits.

“When my constituents who are very good with their numbers tell me that they’re going to [pay] $5,000 to $10,000 more in taxes, you know, I’m supposed to represent their interests,” said Rep. Dana Rohrabacher, one of three California Republicans who opposed the bill.

But many other Republicans in districts where some middle-class taxpayers could face increases — many of them representing affluent suburban areas, such as Reps. Barbara Comstock (Va.), Brian Fitzpatrick (Pa.) and Mimi Walters (Calif.) — opted to vote for the bill, risking attacks from Democratic opponents in next year’s midterm elections.

Comstock said Thursday that she voted to advance the legislation because it would boost the economy and create jobs but that she would continue working to improve the bill. “There’s a lot of differences between the House and Senate bill, so this is going to be a process,” she said.

GOP strategists have warned in recent months that vulnerable lawmakers need to show some sort of governing accomplishment going into 2018, and the leader of the most prominent super PAC charged with electing Republicans to the House warned Thursday it would help members less if they didn’t back the bill.

“CLF will never spend a dollar attacking a Republican,” said Corry Bliss, executive director of the Congressional Leadership Fund. “But CLF is going to raise and spend $100 million to protect the Republican majority. CLF, like any organization, will allocate resources to friends and family first.”

The House bill delivers more than 80 percent of its overall cuts to corporations, business owners and wealthy families who are subject to the federal estate tax, according to estimates released by the Joint Committee on Taxation. But most middle-class Americans would see an immediate tax cut because of a lowering of individual tax rates, the near-doubling of the standard deduction and a larger child tax credit.

But under the House bill, many households that itemize their deductions — taking advantage of write-offs for state income taxes, medical expenses and more — could see immediate tax increases. In future years, the benefits of the bill for individuals wane because of the phaseout of a key tax credit and because the bill would change how the government calculates inflation, moving people more quickly into higher tax brackets.

Ed O’Keefe contributed to this report.