This post was updated on January 3 at 12:24pm.

President-elect Donald Trump has shown a rare talent for leaving his own allies and friends in a difficult and awkward spot, and he demonstrated that talent again on Monday, weakly condemning a move by House Republicans to gut the Office of Congressional Ethics as a misplaced priority, while also calling the office “unfair”—a very public demonstration of why even the president-elect’s strongest allies sometimes find it difficult to follow his lead.

Within hours of his tweets, and amid broad public outcry, the House Republican caucus called an emergency meeting, and pulled the amendment—a black eye for the congressional GOP and its leadership, perhaps made even more humiliating by the public rebuke from their own president-elect.

Trump weighed in around 10 a.m. on Tuesday, about 14 hours into a hubbub over the House move.

At first glance, it looked as if Trump was picking a fight with Congress, which to a certain extent he is. But that overstates what he actually said. Trump went out of his way to acknowledge the complaint, voiced by some members of Congress, that the ethics committee stepped on their due-process rights and was time-consuming. (Norm Ornstein makes the case for the committee here.) His only complaint was about the timing and priority of the move; needless to say, Trump would like the House to focus first on the things that he cares about most.

Trump’s tweets seem to demonstrate his keen ability to read an audience and react. They came after hours of pushback, but at a time when the fate of the amendment still seemed undecided—and leaning toward survival. By stepping into the debate when he did, he may have helped tip the balance against it, but he may also have jumped in just in time to claim credit for a shift that was already underway.

Put yourself in the shoes of Representative Bob Goodlatte, who on Monday put forward an amendment in the GOP Conference to gut the office. On the one hand, Trump spent the last month of the campaign claiming he would “drain the swamp” of corruption in Washington, while Speaker Paul Ryan and Majority Leader Kevin McCarthy, the House Republican leaders, both opposed Goodlatte’s amendment. On the other hand, Trump demonstrated no public interest in fighting corruption since he got elected, and has obstinately refused to acknowledge, much less mitigate, his own conflicts of interest. It must have seemed like a safe bet that the president-elect would look the other way.

That’s presumably what Kellyanne Conway, a Trump adviser, was surmising when she went on MSNBC’s Morning Joe on Tuesday and faced a series of hostile questions about the House Republicans’ move Monday night. While Conway said she had not spoken with Trump about the vote, she offered a strong defense of gutting the office, saying that the GOP maintaining control of Congress meant “there’s a mandate there for them to make significant change.”

Ryan was left somewhere in the middle, too. He opposed the move within the conference, but he still allowed the rules package to proceed. Shortly after Trump’s tweets, he issued a long statement trying to have it several ways. The speaker acknowledged, “After eight years of operation, many members believe the Office of Congressional Ethics is in need of reform to protect due process and ensure it is operating according to its stated mission,” but he also insisted he had “made clear to the new Chair of the House Ethics Committee that it is not to interfere with the Office’s investigations or prevent it from doing its job,” a somewhat toothless demand.

Trump’s mild scolding does point to the tensions to come between the White House and the Republican Congress, which have made great efforts to project unity, despite Trump’s near-constant departures from—and sometimes flagrant disrespect for—the party line. One division is on Russia, where Trump has refused to even countenance the idea that the Kremlin was involved in malicious hacking in the presidential campaign, while many GOP members of Congress see it as dangerous intervention by a hostile regime. Gutting the OCE is another case where congressional Republicans have their own interests, and intend to pursue them. After all, the GOP caucus has undercut ethics rules before; the OCE was created after a series of scandals involving Republican members; and members have wanted to remove that threat for some time.

After calling an emergency meeting around noon, the House Republican caucus abruptly reversed course, removing the amendment to gut OCE from the rules package—a reversal as sudden as the introduction of the rule. That’s embarrassing for Goodlatte, perhaps the only member who is known to have supported the amendment, since the vote on it was private and anonymous. Ryan, whose Tuesday morning statement signaled acquiescence with his caucus, is also caught somewhat out in the open, showing that his control over members is weak. But Trump wins, as he always seems to do: He gets credit for helping sink the maneuver, imparting some “drain the swamp” glow without his actually taking steps to fight corruption, or even to condemn dismantling ethics watchdogs. And how could he have done otherwise? Picking a real fight with Congress on ethics would carry the risk that it might have a change of heart and actually start pushing Trump for accountability on his own ethical challenges.

Moving to pass the ethics rules now was a page torn right out of the Trump playbook: The theory is that you can get away with doing things that are egregious violations of norms, and even ones that might be politically toxic if handled through the typical political process, if they are instead dealt with brusquely, casually, and secretively. By the time the gutting of OCE was known, it was already passed and incorporated into the rules package, and the opponent best positioned to stop it, Paul Ryan, had already been steamrolled. But they play turned out not to work as well for the House as it has for the president-elect. It will be much harder to pass later, after having been pulled for public outcry. The abrupt demise of the amendment suggests two lessons for Republicans in Congress: Guessing Trump’s mind is impossible, and the tactics that work for him are liable to blow up in anyone else’s face.