WASHINGTON—President Trump told advisers he is open to keeping Deputy Attorney General Rod Rosenstein on the job, and allies of the No. 2 Justice Department official said Tuesday he has given them the impression he doesn’t plan to quit.

That raised at least the possibility that a roller coaster of a week could end with no major shake-up in the top ranks of the Justice Department, even as White House and Justice officials cautioned that it was impossible to know for sure what Mr. Trump would do. Mr. Rosenstein oversees special counsel Robert Mueller’s investigation into Russian meddling in the 2016 election and any links to Trump campaign officials. Mr. Trump has dismissed the probe as “a witch hunt.”

The president has told advisers that he wants to hear directly from Mr. Rosenstein about reports that he discussed secretly recording the president and recruiting cabinet members to remove him from office, according to people who have spoken to the president. That meeting is scheduled for Thursday afternoon.

The president’s willingness to hear out Mr. Rosenstein signaled to advisers that he harbors doubts about whether the top official in fact sought to have him ousted him from the Oval Office, these people said. The issue arose after the New York Times reported that Mr. Rosenstein floated the idea in early 2017, something he has strongly denied.

Republicans in the House were preparing a subpoena for memos allegedly detailing Mr. Rosenstein’s comments on surreptitiously recording the president, according to a person familiar with the matter.