House Speaker John Boehner speaks during a news conference with House Majority Leader Kevin McCarthy and Representative Cathy McMorris Rodgers, July 28, 2015. Bloomberg AFP/Getty

It’s hard to imagine now, given the intraparty barbs that appear to have helped drive him from office, but John Boehner used to be known as a rebel.

When the 41-year-old salesman arrived in Congress from Ohio in 1991, he quickly gravitated toward a small but increasingly vocal group of agitators within the GOP ranks. They were tired of serving in the minority, and they would soon make clear that they were tired of being led by men—yes, they were all men—whom they viewed as too conciliatory toward Democrats.

So the Gang of Seven—as Boehner and his fellow impatient freshmen were known—made noise, in private at party meetings and in public on the House floor, with C-SPAN cameras helpfully whirring, as they railed against what they viewed as a corrupt and intransigent Democratic majority. When Republicans swept into power after the 1994 election, Newt Gingrich vaulted into the speakership and Boehner trailed behind him, becoming the party’s top message man as GOP conference chairman.

Of course, as the current version of Boehner would be happy to tell you over red wine and cigarettes at the end of a long day, complaining from the minority is a lot easier than actually governing from the majority. After some initial successes, that new crop of GOP leaders started fighting among themselves, culminating in an aborted coup against Gingrich. Boehner’s role in that effort remains murky, but when the party lost a slew of seats in 1998, he was a convenient scapegoat. He lost the No. 4 leadership slot to Rep. J.C. Watts and decided to throw himself into his work on the Education and the Workforce Committee.

That moment marked a turning point for Boehner, the start of his transformation from agitating rebel to pragmatic deal-maker. That change, it turned out, was what enabled him to rise to the speakership, but it also may have led to his ultimate downfall.

As Education chairman, Boehner teamed up with the new Republican president, George W. Bush, to push through a landmark education reform bill—No Child Left Behind. Crucially, he didn’t just write the bill with Republicans; Boehner teamed up with Democratic Rep. George Miller and even—gasp!—Sen. Edward Kennedy to get the measure through. The entire venture showed that Boehner could be patient and focused, that he could compromise and count votes.

Boehner also learned how to cultivate relationships. During his first stint in leadership, he feuded intensely with then Majority Whip Tom DeLay. (The enmity was especially strong between their staffs.) But by the time DeLay, then serving as majority leader, was encountering significant legal trouble in 2005, the two men had reached something of a truce. Boehner quietly donated money to DeLay’s legal defense fund—and batted away reporters who wanted to write that he was eyeing a return to leadership, even though he was.

When DeLay was indicted and stepped down, Boehner stepped up, beating Rep. Roy Blunt in a dramatic contest for majority leader. Blunt’s allies whispered that Boehner was an insufficiently conservative, Kennedy-loving compromiser, even though Boehner had long been a crusader against profligate spending, earmarks, and farm subsidies. But Boehner was well-liked by the caucus on a personal level, and he proved a more adept vote-counter than Blunt.

Boehner took over the top Republican job just as the party was banished to the minority after 2006, leading the fight against Speaker Nancy Pelosi and—two years later—President Obama until the GOP swept back into power in 2010. But it didn’t take long for conservative mistrust of the new Republican speaker to fester.

In 2011, Boehner began a long and ultimately fruitless series of negotiations, some of them secret, with Obama on a “grand bargain”—a global bipartisan deal on taxes and spending that would have transformed the legislative landscape for years. House Majority Leader Eric Cantor, whose relations with Boehner were always strained, disapproved of the talks. And so did the new crop of conservative Republican freshmen, many of whom—like Boehner two decades earlier—didn’t trust their own leaders any more than they trusted Democrats.

Boehner might well have retired at the end of 2014—on many days, he seemed fed up with the job of managing an unmanageable conference—but Cantor’s surprising reelection loss in that year’s primary made that a moot point. Boehner, his allies have long said, cares enough about the House as an institution that he would not leave unless he was convinced a responsible successor was in place.

Whether Boehner feels that is true now, or simply believes he has no choice but to leave, is unclear. Friends and foes alike in the House had believed that he could probably survive the latest challenge to his leadership but wouldn’t stay beyond the end of the 114th Congress. By speeding up that time frame and bucking the conventional wisdom, Boehner showed he still has the capacity to be a rebel.

We want to hear what you think about this article. Submit a letter to the editor or write to letters@theatlantic.com.