Sens. Elizabeth Warren, Bernie Sanders and other Senate Democrats running for president might find themselves pulled off the campaign trail for the trial of President Trump, or face arrest, a former Senate parliamentarian told The Post.

Should Democrats in the House of Representatives formally impeach the president — something that is widely expected by the end of the year — a January Senate trial is almost certain. The president’s fate would then be decided by a vote of 100 senators, with a two-thirds majority required for his removal.

The timing, however, couldn’t be worse for many of the party’s leading lights, who could be compelled to come off the campaign trail to sit for weeks just before voting begins.

“The senate collectively has the power to compel the attendance of absent senators and the Senate collectively acts by its majority and Mitch McConnell is the majority leader. So he has the ability,” former Senate parliamentarian Alan Frumin said. “If push comes to shove, compelling means arresting. ”

It could even mean sending the chamber’s Sergeant at Arms to Iowa to collect truant senators if need be, said Frumin, who spent 19 years in the position and is one of the foremost experts in the rules and procedures of the body.

While Democratic senators might ordinarily relish their Constitutional obligation to sit in judgment over the polarizing billionaire, the trial couldn’t come at a worse time in the 2020 Democratic primary calendar. The Iowa caucuses are Feb. 3, with the New Hampshire primary coming just eight days later. South Carolina and Nevada will follow before the month is out. The candidates have invested millions of dollars in the states, and many have pinned their future on strong showings.

“If we expect the Senate trial to happen in January then that will necessarily take many of these Democrats running for president off the campaign trail to act as jurors. That is a fact,” Antonia Ferrier, a former McConnell spokeswoman told The Post.

Though the Democratic Party’s left flank long promoted impeachment, the trial may ironically leave the field clear of liberal standard bearers. Among the 2020 frontrunners, only former Vice President Joe Biden and Pete Buttigieg will be beyond McConnell’s grasp.

“At the end of the day, the candidates who are not members of the Senate benefit from this. This is something that the Biden folks, the Buttigieg team and even Andrew Yang are happy about,” Evan Siegfried, a GOP strategist and president of Somm Consulting, told The Post. “Every move is critical and every handshake you have is vital, it can be a very big thing. You want to hoover up as many potential supporters and voters as possible, especially in Iowa and New Hampshire.”

In practice, however, Senate impeachment hearings tend to be calmer affairs.

In advance of Bill Clinton’s Senate trial in 1999, both GOP majority leader Trent Lott and minority chief Tom Daschle came to an early understanding that they wanted to avoid the “circus” which had played out in the House.

Frumin, who served on the Senate floor as senior assistant parliamentarian during the Clinton trial, said there was no expectation at the time that senators needed to be present for every second of the event and he recalled regular attendance was “sparse.”

“They came and went. If you are envisioning a situation where during the trial, 100 senators are sitting at their desks in rapt attention — that didn’t happen,” he said.

Frumin and those close to McConnell say many of the same institutional impulses may temper his more partisan instincts and may lead to some early compromises with Dem leader Chuck Schumer.

“It all has to be negotiated between the two leaders,” said Ferrier. “It is a fully negotiated agreement on how to handle and how the Senate will proceed with the trial.”