The House of Representatives on Wednesday voted almost entirely along party lines to impeach President Trump following a rancorous, daylong debate — making him just the third president in US history to suffer the congressional rebuke.

The historic vote sets up a showdown in the GOP-led Senate, where Republicans have said there is virtually no chance Trump would be convicted and removed from office.

The back-to-back votes came after 8 p.m. on two articles of impeachment, one for abuse of power and the other for obstruction of Congress.

The article to impeach on abuse of power passed 230-197, with Rep. Tulsi Gabbard (D-Hawaii) voting “present.” Two Democrats — Jeff Van Drew of New Jersey and Collin Peterson of Minnesota — broke ranks and voted with all Republicans against impeachment.

The vote to impeach on obstruction of Congress passed 229-198 with one — Gabbard — again voting “present.” Three Democrats — Van Drew, Peterson and Maine’s Jared Golden — voted with all Republicans against the charge.

The White House immediately blasted the results, saying in a statement, “Today marks the culmination in the House of one of the most shameful political episodes in the history of our Nation.

“Without receiving a single Republican vote, and without providing any proof of wrongdoing, Democrats pushed illegitimate articles of impeachment against the President through the House of Representatives.”

House Speaker Nancy Pelosi — clad in a black dress to mark what she called a “solemn” and “sad” proceeding — said Congress must “defend democracy” by evicting the president from the White House.

Trump, meanwhile, said earlier in the day that despite the Democrats’ patriotic talk, they were actually perpetrating “an assault on America.”

It was a day marked by hyperbole and over-the top rhetoric from both parties, with Pelosi invoking the Pledge of Allegiance and the Battle of the Bulge and Georgia GOP Rep. Barry Loudermilk saying Jesus Christ got a better deal from ­Pontius Pilate.

“Last week, in observance of the 75th anniversary of the Battle of the Bulge, members [of the House of Representatives] traveled to that hallowed ground to express our gratitude to the heroes who sacrificed everything to secure victory of freedom over tyranny, not just for America, but for the world. Today, we are here to defend democracy for the people. May God bless America,” Pelosi said after reading several lines from the Pledge, her right hand placed across her heart.

“The veterans of that battle who were there, in their 90s, told us how after the war was won, the Europeans whom they liberated would ask, ‘Why did you risk us? You don’t know us. And give your lives to save us, we’re not Americans.’ And our men would say, ‘We came here to fight for you, not because you are Americans, but because we are Americans.’ ”

Loudermilk later weighed in with his biblical analogy.

“When Jesus was falsely accused of treason, Pontius Pilate gave Jesus the opportunity to face his accusers. During that sham trial, Pontius Pilate afforded more rights to Jesus than Democrats have afforded this president and this process,” he said.

Rep. Mike Kelly (R-Pa.) even compared the impeachment vote to the Japanese sneak attack on Pearl Harbor.

“On Dec. 7, 1941, a horrific act happened in the United States, and it’s one that President Roosevelt said, ‘This is a date that will live in infamy.’ Today, Dec. 18th, 2019, is another date that will live in ­infamy,” he said.

At one point, Republicans stood and called for a moment of silence for the 63 million Americans who voted for Trump — and the Democrats remained silent as well.

Pelosi invoked the Constitution to argue that the Founders’ vision for a republic was threatened by Trump’s actions in Ukraine and refusal to cooperate with what he called a partisan “witch hunt.”

His accusers charge that Trump abused his power when he asked Ukrainian President Volodymyr Zelensky to investigate Democratic primary candidate Joe Biden and his son while Trump was withholding a promised White House meeting and critical military aid for the US ally.

Defending Trump, Republicans argued that he was wary of corruption in Ukraine and said that since most of the US aid was ultimately released, no harm was done.

Rep. Doug Collins of Georgia, the top Republican on the Judiciary Committee and a staunch foe of the impeachment push, warned that the Founders were just as concerned about a purely partisan impeachment wielded by the power of a majority party.

“This has not been a surprise and it’s not even something that we would not have thought about. From the very moment that the majority party in this House won, the inevitability that we would be here today was only a matter of what date they would schedule it,” ­Collins said during his opening ­remarks.

The president, who departed in late afternoon for a rally in Michigan, fired off a furious letter to Pelosi on Tuesday denouncing the “vicious crusade” against him but acknowledging he was powerless to stop the expected outcome.

Rep. Adam Schiff — a key figure in the impeachment inquiry as chair of the Intelligence Committee — delivered a withering attack on Trump, saying that Alexander ­Hamilton showed “staggering ­prescience” when he warned of an “unprincipled” and “despotic” person winning the presidency.

Hamilton, Schiff said, feared “a man unprincipled in private life, desperate in his fortune … despotic in his ordinary demeanor” and “known to have scoffed in private at the principles of liberty” winning the White House.

“Could we find a more perfect description of the present danger emanating from 1600 Pennsylvania Avenue? The framers crafted a Constitution that contemplated free and fair elections for the highest office in the land, but also afforded the Congress with the power to remove a president who abused the powers of his office for personal gain,” said the California Democrat — often mocked by the president as “Shifty Schiff.”

The next step is a trial in the Senate, likely in January.