President Trump on Thursday chided Rep. Liz Cheney (R-Wyo.) for her opposition to his troop withdrawals, adding his voice to an open feud between some of his closest congressional allies and the highest-ranking Republican woman on Capitol Hill.

“Liz Cheney is only upset because I have been actively getting our great and beautiful Country out of the ridiculous and costly Endless Wars,” Trump tweeted. “I am also making our so-called allies pay tens of billions of dollars in delinquent military costs.”

His dig at Cheney comes as several Republicans have accused her of disloyalty because she has bucked Trump on national security issues — including pulling U.S. troops from Afghanistan and Germany — and has embraced public health advice and officials of whom Trump has been dismissive.

Some of Cheney’s critics have called for her to be removed from her leadership position as chair of the House Republican Conference. Trump did not advocate that himself, but he retweeted messages from some of the congresswoman’s most vocal antagonists who have advocated for her replacement, including Rep. Matt Gaetz (R-Fla.).

Among the tweets Trump shared was one by Gaetz that said Republicans “deserve better” than Cheney. Trump also shared a tweet by Sen. Rand Paul (R-Ky.) in which he called Cheney’s opposition to Trump’s troop withdrawals “unacceptable.” In a television interview Wednesday, Paul accused Cheney of trying to “sabotage” Trump’s foreign policy and said, “I don’t think she’s good for the country.”

Cheney, who warned in the past month of “a serious error” with “grave consequences” if troops were pulled from Germany, has sought to play down her differences with Trump as the rancor has spilled into public view.

Asked Thursday about Trump’s tweet, she said it was “no secret the president and I disagree on some foreign policy issues.”

But Cheney said that as a member of the Armed Services Committee, her biggest obligation is to “provide for the defense of the nation.” She said she would continue to speak out on foreign policy issues.

Cheney has also drawn fire from fellow Republicans for defending Anthony S. Fauci, the nation’s top infectious-disease specialist, whose blunt talk and high profile have undercut his standing somewhat in the White House.

Cheney has taken a forceful position in favor of wearing face coverings to curb the spread of the coronavirus — something the president has been reluctant to do — tweeting a photo in the past month of her father, former vice president Richard B. Cheney, wearing a mask with the hashtag “realmenwearmasks.”

When asked Thursday about the shots that have been taken at Cheney, House Minority Leader Kevin McCarthy (R-Calif.) sought to minimize differences within his caucus and said there is “no question” that Cheney will keep her leadership position.

“In our party, we’re allowed to have differences of opinion, especially when it comes to foreign policy,” he said at a news conference. “I think Liz Cheney and the president agree 98 percent of the time. There’s nothing wrong with having a discussion about different ways of going forward. But I think the best part is that we’re united and that we don’t air these in public.”

Seung Min Kim and Paul Kane contributed to this report.