WASHINGTON — President Trump on Tuesday angrily denounced the looming House votes to impeach him as a “Star Chamber of partisan persecution” by Democrats, describing the effort to remove him from office as an “attempted coup” that would come back to haunt them at the ballot box next year.

On the eve of the historic votes, Democrats reached a critical threshold, gathering majority support to impeach Mr. Trump, as the president raged against the proceedings. In an irate and rambling six-page letter to Speaker Nancy Pelosi, Mr. Trump portrayed himself as the victim of enemies determined to destroy his presidency with false accusations.

“This is nothing more than an illegal, partisan attempted coup that will, based on recent sentiment, badly fail at the voting booth,” Mr. Trump declared, describing a process enshrined in the Constitution as an attempted government overthrow.

“History will judge you harshly as you proceed with this impeachment charade,” he wrote.

In a missive full of unproven charges, hyperbole and long-simmering grievances against his own government — at one point, he referred to leaders of the F.B.I. as “totally incompetent and corrupt” — Mr. Trump angrily disputed both of the impeachment charges: abuse of power and obstruction of Congress.