They passed legislation to stop him from lifting sanctions on Russia. They recoiled at his snap decision to ban transgender Americans from the military. And they warned him in no uncertain terms not to fire the attorney general or the special counsel investigating the president and his aides.

Republican lawmakers have openly defied President Trump in meaningful ways this week amid growing frustration on Capitol Hill with his surprise tweets, erratic behavior and willingness to trample on governing norms. But at the same time, they’ve worked to advance legislation they want him to sign.

In the latest signs of a backlash, Sen. Charles E. Grassley (R-Iowa), chairman of the Senate Judiciary Committee, said Wednesday he would not hold hearings on a replacement if Trump dismissed Attorney General Jeff Sessions, and Sen. Lindsey O. Graham (R-S.C.) said Thursday he would pursue legislation that would prevent Trump from summarily firing special counsel Robert S. Mueller III.

“Some of the suggestions that the president is making go way beyond what’s acceptable in a rule-of-law nation,” Graham said. “This is not draining the swamp. What he’s interjecting is turning democracy upside down.”

Some of the defiance came from already outspoken Trump critics such as Graham and Sen. Ben Sasse (R-Neb.), who rebuked the president from the Senate floor Thursday.

(The Washington Post)

“If you’re thinking of making a recess appointment to push out the attorney general, forget about it,” Sasse said. “The presidency isn’t a bull, and this country isn’t a china shop.”

But some generally pro-Trump lawmakers emerged Wednesday as critics of the unexpected transgender ban, which the president announced in a series of morning tweets with no notice to key figures on Capitol Hill who might normally be called upon to defend his actions.

Sens. Joni Ernst (R-Iowa) and Orrin G. Hatch (R-Utah) issued statements Wednesday saying Trump went too far in banning all transgender service members. On Thursday, House Speaker Paul D. Ryan (R-Wis.) refused to back the ban, saying he would await a Defense Department review of the issue despite Trump’s clear wishes.

“I look forward to seeing what they actually produce,” Ryan said.

On the sanctions issue, the Senate, on a 98-to-2 vote on Thursday, cleared legislation targeting Russia, Iran and North Korea that the Trump administration had sought to water down — particularly a provision that would require Trump to seek congressional approval before lifting sanctions against Russia. The bill had passed the House earlier this week on a 419-to-3 vote.

Several lawmakers said that if Trump vetoes the measure, Congress was prepared to override it.

“No president likes Congress to tie their hands,” said Sen. Marco Rubio (R-Fla.). “This is a very unique and particular case at a key moment. . . . If the president vetoes it, as is his right, there will be a debate, but I believe it will be overridden.”

1 of 15 Full Screen Autoplay Close Skip Ad × What lawmakers are saying about Trump’s decision to ban transgender people from the military View Photos In a series of tweets, the president announced the reversal of an Obama administration decision to allow members of the transgender community to serve openly. Caption In a series of tweets, the president announced the reversal of an Obama administration decision to allow members of the transgender community to serve openly. House Minority Leader Nancy Pelosi (D-Calif.) Pelosi noted that Trump made his announcement on the 69th anniversary of President Harry Truman’s executive order desegregating the military, adding that the president “has chosen this day to unleash a vile and hateful agenda that will blindside thousands of patriotic Americans.” Oliver Contreras/For The Washington Post Buy Photo Wait 1 second to continue.

Despite the brush backs, Republican lawmakers are continuing to act on key parts of Trump’s legislative agenda. Those items, however, face major hurdles.

The House on Thursday cleared a package of spending bills that boost defense spending and earmark $1.6 billion to build 74 miles of border fencing — making good on Trump’s promise to “build the wall” to separate the United States and Mexico. The bill, however, breaks existing budget caps. Any final spending agreement will have to be negotiated later in the year with Democrats, who have so far refused to support any wall funding.

The Senate, meanwhile, continued working haltingly toward passage of a health-care bill that swallowed much of the attention and energy on Capitol Hill.

On Thursday evening, a group of senators that included Graham and John McCain (R-Ariz.) faced television cameras inside the Capitol to make an unusual declaration: They would vote for the health-care bill in the Senate only if they were assured by House Republican leaders that they would not in turn pass it into law.

The senators’ hope was to convene a conference committee, an open-ended negotiation that could keep the internal battle over replacing the Affordable Care Act alive for months. The effort would potentially distract from other contentious issues, such as a tax overhaul.

That tax initiative took a modest step forward Thursday when key White House officials and congressional leaders issued a joint statement of principles for the overhaul — one that discarded a controversial tax on corporate imports favored by Ryan.

The House, however, has yet to pass a 2018 budget, a key initial step Republicans are counting on to be able to pass the tax overhaul without involving Democrats. House GOP aides indicated Friday that the matter would be left until September, after a planned five-week recess. Lawmakers in September will have to confront a possible government shutdown and federal default.

The most palpable frustration on Capitol Hill, however, tends not to concern health care or tax reform or appropriations, but rather Trump’s chaotic White House and his Twitter musings.

Recent weeks have seen lawmakers who have brushed aside Trump’s antics by calling him “refreshing” and “unconventional” more willing to voice their concerns.

After the transgender tweetstorm Wednesday, Rep. Thomas J. Rooney (R-Fla.) expressed frustration that Trump’s tweets come out of nowhere, leaving GOP lawmakers out of step with the president.

“When we do stuff in here that we’re trying to message, and there’s a tweet that comes out that’s different than that, it throws us off,” he said. “Based on what we’re doing in here this week, I don’t know what the connection is.”

Especially alarming to congressional Republicans are Trump’s recent tweets about Sessions and Mueller — such as a Saturday tweet asking why the two are not investigating alleged “crimes” by former Democratic presidential candidate Hillary Clinton and by former FBI director James B. Comey. A subsequent tweet Tuesday accused Sessions of taking “a VERY weak position” on investigating Clinton and leakers of intelligence secrets.

Sessions has seen an outpouring of support this week from his former colleagues in the Senate, where he served for two decades.

“I think the president has to keep in mind a couple of things,” Sen. Richard C. Shelby (R-Ala.) said Thursday. “Jeff Sessions, like all Cabinet members, works for the United States of America. They don’t work for the president; they work for the people. . . . The president’s a smart man, and he ought to know that.”

Meanwhile, key lawmakers have voiced confidence in Mueller. “I think it’s in the president’s interest that he stays where he is and continues and does his job,” Ryan said Thursday.

Graham said Thursday that a move against Mueller would represent “the beginning of the end of the Trump presidency.” His bill, which he said he is drafting in conjunction with Democratic colleagues, would require a federal judge to review any move to dismiss a special counsel.

Fellow Republicans offered support for the move. “I hope that it doesn’t become needed,” said Sen. Richard Burr (R-N.C.), who is pursuing his own investigation of Trump as chairman of the Senate Intelligence Committee.

Dalton Bennett and Karoun Demirjian contributed to this report.

Read more at PowerPost