Derek T. Muller is an associate professor at Pepperdine University School of Law.

Donald Trump speaks in Boca Raton, Fla., on Sunday, March 13. (Erik S. Lesser/European Pressphoto Agency)

Donald Trump will be the GOP’s presidential nominee. Within the party, talk of a brokered Republican National Convention or even a supporting a third-party candidate has circulated among those hoping to stop him from becoming the next president, leaving Trump antagonists across the spectrum to ponder whether there’s any fail-safe left, after November, to stop a Trump administration from becoming a reality.

There is. The electoral college.

If they choose, state legislators can appoint presidential electors themselves this November, rather than leaving the matter of apportioning electoral college votes by popular vote. Then, via their chosen electors, legislatures could elect any presidential candidate they prefer.

[Five myths about the electoral college]

Remember, Americans don’t directly elect the president. The electoral college does: Slates of electors pledged to support presidential and vice presidential candidates are voted upon in each state every four years. Each state, and the District of Columbia, is apportioned at least three of the 538 electors, allocated by the total number of U.S. senators and House members each state has.

In December, these electors will gather in their respective states and cast votes for president and vice president. And in January, Congress counts these votes, determines if a candidate has achieved a majority — at least 270 votes — and then certifies a winner.

We take it for granted that the individual votes we cast will be the ones that select the slate of presidential electors in our state. But the Constitution makes no such guarantee. In fact, it says the states appoint electors “in such Manner as the Legislature thereof may direct.”

Some  of the Founders worried that rash decision-making by the collective body politic would be “radically vicious” or “liable to deceptions” if they directly elected the president, for the people would lack the “capacity to judge” candidates. While members of the House of Representatives would be accountable directly to the people, presidential elections would occur indirectly. Electors, not the people, would elect the president. And state legislatures could decide how. (Most states now have laws binding electors to vote for the candidate who wins their state’s popular vote — but many states don’t.)

Donald Trump will almost certainly be the delegate leader heading into July's Republican National Convention – but that doesn't mean he'll win the nomination outright. (Peter Stevenson/The Washington Post)

In the earliest presidential elections, many states did not have popular elections for electors. Their legislatures simply chose electors. Over time, states gradually moved toward the popular elections we now take for granted.

[The national popular vote effort, explained]

But state legislatures have occasionally retained the power for themselves. In 1876, for instance, the new state of Colorado opted not to hold a popular election for electors, with the legislature claiming publicly that it lacked sufficient time to organize an election. It’s more likely that Republican legislators worried that the people would vote for three Democratic electors and move to end Reconstruction in a closely contested election. The state legislature chose to retain the power to choose electors for itself — just that one time.

And state legislatures have modified the rules for the selection of presidential electors when they worry that the people of the state will vote for a disfavored candidate. In 1892, for instance, Democrats gained control of the Michigan legislature. They decided that presidential electors should be appointed according to popular vote totals in each congressional district, as opposed to the statewide winner-take-all system that had previously existed. Michiganders had consistently voted for a slate of Republican electors in the recent past, and the move to elections by district guaranteed that Democrats would win at least a few of electoral votes.

In McPherson v. Blacker, the Supreme Court approved Michigan’s move and found that the mode of appointing electors was “exclusively” reserved to the states. The court would not interfere with the state legislature’s decision, whatever the reason.

State legislatures should consider whether to retake this authority in the 2016 election in an effort to stop Trump. Republicans control 31 state legislatures. Many could consider this proposal, but the Texas state legislature is a natural place to start. It could easily pass a law returning power to the legislature. On Election Day, the legislature could decide whether to vote for Trump or Mitt Romney, the prior Republican nominee; former Texas governor Rick Perry, who dropped out of the 2016 race early on; a popular GOP figure such as Condoleezza Rice, whose name has recently been floated as an alternative; or their own junior Sen. Ted Cruz, presently trailing Trump in the Republican Party delegate count.

[Stop Trump campaign plans to push forward]

Texas’s 38 red-state electoral votes are almost assuredly required for any Republican to get the 270 electoral votes needed to win. Casting them for someone other than Trump doesn’t help likely Democratic nominee Hillary Clinton, because she also needs 270. So while one state’s electoral votes may not seem like much, it might be enough to deprive either candidate a majority.

And in the event no candidate wins a majority of the electoral votes, the House of Representatives selects the winner. Each state’s delegation of representatives gets one vote and selects among the top three electoral vote-getters — which would include the candidate who receives Texas’s 38 votes. Republicans control these House delegations, and they could select from Trump, Clinton and Texas’s preferred non-Trump candidate.

GOP leaders are scrambling to minimize Donald Trump's dominance in the polls, leaving many wondering what would happen if no one candidate wins a clear majority before the national convention. (Jenny Starrs/The Washington Post)

The decision need not rest with a single state, of course. Many state legislatures may worry about voters choosing between Trump and Clinton. It’d be a long shot, to be sure, but if enough state legislatures voted for their own electors this year, they could collectively secure the 270 electoral votes for their preferred candidate, who might not be either of these two candidates.

[U.S. primary results by state]

To take this extraordinary step, state legislators would have to decide that this election calls for an extraordinary change. And, of course, acknowledge that it could be deployed against any candidate in any presidential election — this year, four years from now and onward. It has seldom been used. But perhaps — just this once — legislators will conclude that the times call for a change to how we vote for the president.

Clearly, Trump supporters and, potentially, anyone who sees this sort of procedural move as a dirty trick, would object to this as anti-democratic. But voters’ preferences would still be reflected — albeit indirectly — in the decisions made by the state legislatures, whose members are elected by the people. And the existence of the electoral college, no matter how electors are chosen, means that the people, technically, have already been indirectly selecting their presidents.

Trump hasn’t won yet. But it is increasingly likely that we will reach precisely the kind of scenario that the Founders worried about — divisive political discourse threatens to thrust a dangerous candidate into office who appears inclined to govern more like a monarch than a president. Opportunities remain for cooler heads to prevail in our presidential election. And state legislatures should consider doing so this year.

Correction: This article has been updated to reflect that state legislatures could vote for electors on Election Day, while the electoral college votes in December.