WASHINGTON—Attorney General Jeff Sessions has urged the White House not to fire his deputy, Rod Rosenstein, adding that he would consider resigning himself if President Donald Trump moved to do so.

The warning was conveyed to White House counsel Don McGahn in recent days, with Mr. Sessions communicating strongly that pushing out Mr. Rosenstein would be a bad idea, said a person familiar with the message to Mr. McGahn.

Mr....