When Rep. Steve King was ushered into House Minority Leader Kevin McCarthy’s office Monday night, after sparking outrage for questioning whether the term “white supremacist” is offensive, he expected to be scolded. He did not expect his career in congressional politics to effectively end.

But as the Iowa Republican sat on a couch beneath an eight-foot-tall portrait of Abraham Lincoln, it quickly became clear that ­McCarthy — whom King has long privately knocked as soft — was taking a hard line.

King, an ally of President Trump’s and a regular guest on conservative media programs, offered to “go quiet,” according to three people familiar with the exchange who were not authorized to speak publicly.

McCarthy dismissed the suggestion — and the nine-term Republican was soon stripped of all his committee assignments.

Rep. Steve King (R-Iowa) in a Jan. 10 interview asked how the terms “white nationalist” and “white supremacist” became offensive.

For McCarthy, 53, the hour-long confrontation with King was a critical moment early in his tenure as the new leader of Republicans in the House, testing whether the easygoing Californian was willing to take on a popular conservative and assert himself in the wake of sweeping GOP defeats in the 2018 elections and the high-profile speakership of Rep. Paul D. Ryan (R-Wis.).

It was also a reminder of how Republican leaders have done little to police their ranks on the charged issue of race in recent years, from their embrace of Trump despite him casting doubt on President Barack Obama’s U.S. citizenship to their support of the divisive King — making his punishment an outlier rather than the standard.

McCarthy’s diminishment of King came after years of inaction by House Republican leaders, including McCarthy, who served as majority leader from 2014 until earlier this year and was majority whip for more than three years before that. During that time King made repeated statements disparaging immigrants and minorities, as did other members, but leaders chose not to move against them — fearful that taking harsh action would antagonize the party’s conservative base.

McCarthy referenced that history in an interview with a local radio station this week. “Past leaders did not act,” he said. “I just felt, I don’t care if it hurts me or not — I’ve got to just do the right thing.”

Many Democrats inside and outside the Capitol expressed skepticism about McCarthy’s change of heart and argued that his effort to now distance the GOP from King did little to erase its past support for him.

Former Obama White House adviser Dan Pfeiffer mocked ­McCarthy on Twitter for “wrestling so deeply with Steve King’s long record of racism” yet still giving thousands to his reelection campaign.

According to the Center for Responsive Politics, King received more than $27,000 last year from political committees affiliated with GOP leaders, including $5,000 from ­McCarthy’s group.

House Majority Leader Steny H. Hoyer (D-Md.) was more measured when asked about McCarthy, saying, “It’s never too late to do the right thing.”

McCarthy can expect more challenges — and tense encounters — in the coming months as he deals with a powerful rival in House Speaker Nancy Pelosi (D-Calif.), who brings decades of experience and a reputation for savvy and at times savage responses to her Republican counterparts.

McCarthy’s relationship with Trump hovers as another variable. While he has drawn attention for carefully cultivating his presidential bond, to the point of bringing the president a jar of his favorite Starburst candy, the deluge of investigations Trump faces could cause unease among members of his caucus and force ­McCarthy to choose between protecting the president or them.

And there are signs that House Democrats are eager to rattle ­McCarthy as he settles into his post — and Pelosi’s former office — and give House Republicans a rough welcome to life in the minority.

On Thursday, as lawmakers rushed to leave the Capitol, House Democrats pressed ahead with a bill to reopen the government through Feb. 28. Republicans were expected to firmly oppose the legislation since it did not include new funding for Trump’s proposed wall along the U.S.-Mexico border.

But when Democrats moved to approve the bill by voice vote, no Republican spoke up to request a recorded vote. In an embarrassment to GOP leaders, the House had essentially approved legislation to reopen the government without Trump’s wall money, and a testy floor exchange between the parties ensued. Democrats later agreed to revote next week.

McCarthy was absent as the fracas played out because he was en route to an event for a group led by Rep. Elise Stefanik (R-N.Y.), whose mission is to elect more Republican women and occasionally take sides in primaries — a position that has riled some of McCarthy’s allies in the leadership, but not McCarthy.

“He’d prefer to avoid Republican on Republican fights, but having been the recruiter for years, he knows how important it is to get the right candidate and he’s going to be supportive of what Elise is doing,” said one McCarthy associate who was not authorized to speak publicly.

From McCarthy’s support of Stefanik to his absence from the floor Thursday to his handling of King, most House Republicans see a political animal trying to navigate a fraught party, often focusing more on repairing the GOP’s brand than in pushing a policy agenda.

Republicans lost 40 seats last year, their worst showing in the House since 1974, and McCarthy’s own California delegation was roughly halved by Democratic gains as suburban voters fled from the party. Not acting against King, to some members, would have been political malpractice.

“These situations arise, and you take the action you take for the right reasons, but you also have to understand the political implications of making a bad decision, and he’s got a clear mind on this,” said Rep. Greg Walden (R-Ore.), a former GOP campaign chairman. “He was direct, took the action and is willing to take the heat and is moving us, I think, in the right direction.”

Rep. Richard Hudson (R-N.C.) said: “One of the reasons we picked him for leader is we think he’s the right guy to lead us out of this. He’s not someone who is going to be comfortable being in the minority. He’s someone who is going to every day wake up and think, ‘How do we get back to the majority?’ ”

King, meanwhile, has been lashing out, saying on a St. Louis radio show this week that the experience has been “perverse” and like a “bad dream.”

McCarthy “decided he’s going to believe the New York Times over Steve King, and that’s a fact,” King said, adding that Rep. Liz Cheney (R-Wyo.), a McCarthy ally and chair of the GOP conference, lacked “the moral authority or the intellectual judgment” to call for his resignation.

King was unavailable for comment Thursday.

The recent controversy began when King said in a New York Times interview, “White nationalist, white supremacist, Western civilization — how did that language become offensive?”

It followed a long string of inflammatory remarks, as well as a seeming embrace of far-right foreign politicians and parties that have been openly hostile to those same groups.

McCarthy, in the local radio interview this week, alluded to the raw political calculus he considered. He made his decision, he said, knowing that he wanted to differentiate himself from Pelosi as the political war of divided government begins.

“I hope it also shows how we deal with our problems, and Speaker Pelosi on her side,” McCarthy said. “. . . She’s got a new member that wants to impeach and cuss [the president]. And she’s done nothing.”

McCarthy was referring to Rep. Rashida Tlaib (D-Mich.), who handed Democrats their first controversy of the new term this month when she told a room of liberal activists that Congress would “impeach the motherf-----,” a reference to Trump.

Pelosi told NBC News soon after: “I probably have a generational reaction to it. I’m not in the censorship business. I don’t like that language, I wouldn’t use that language, but I wouldn’t establish language standards for my colleagues.”

There are other GOP grumbles about how McCarthy handled King, almost entirely on the conference’s right flank, which has long been suspicious of McCarthy, as well as Ryan and Speaker John A. Boehner (R-Ohio) before him.

“If the reporter did a crummy job and did not have a tape recording of the conversation, given the New York Times’ willingness to lie, I would give the benefit of the doubt to Steve King when he says what his intent was and the words he actually uttered,” said Rep. Mo Brooks (R-Ala.).

Some members, speaking privately, are also dismayed by McCarthy’s oversight of committee assignments and argue that conservatives are being passed over for desirable posts — and speculate that the King episode is part of a broader pattern of McCarthy consolidating power.

Several pointed to one case of apparent retribution in which GOP leaders voted this week to remove Rep. Jody Hice (R-Ga.) from the House Armed Services Committee. Hice, a member of the conservative House Freedom Caucus, has frequently clashed with the leadership.

Beyond managing the House GOP, Republicans are looking to McCarthy to join with Trump in fending off an emboldened Pelosi, who has shown a willingness this week to take on Trump with relish amid the ongoing government shutdown, asking him to delay his State of the Union address.

Brooks said he hoped McCarthy would become more aggressive with Democrats in the coming months and bolster the party’s message with “very strong language that catches the eye of the American people.”

“We’ve got to start penetrating the media fog,” Brooks said.

McCarthy’s decision to remove King from his perches on the House Agriculture, Judiciary and Small Business committees was made in coordination with the powerful Republican Steering Committee, which formally decides assignments along with the House leadership.

Inside that meeting, a couple of members asked McCarthy whether King had been misquoted. McCarthy said no and made the case for removal by going over not only King’s comments to the Times but his past statements, according to two Republican lawmakers present.

“Everybody was on the same page, that in a case like this we as a party need to be very clear that doesn’t represent us. Because there’s a real danger if you don’t,” said one of the lawmakers present.

After years of accommodating King in the House and being Ryan’s understudy, McCarthy felt he had to “wake up and lead,” as one ally said of his thinking.

Before meeting King, McCarthy told his aides that he looked up King’s past statements on YouTube. He spoke to Sen. Tim Scott (R-S.C.), a McCarthy friend who is the lone black Republican senator. Eventually, he concluded that anything but throwing King off his committees would be a mistake, for him and the GOP, according to the three people familiar with the meeting.

During the session, King asked McCarthy, “Why don’t you just reprimand me?” He then asked for a “pause” in the decision-making process, the people said.

But his fate had already been decided.