WASHINGTON — President Trump used his Twitter feed on Monday to accuse his former personal lawyer, Michael D. Cohen, of lying under oath and said he should receive the maximum jail sentence as he praised another former adviser, Roger J. Stone Jr., for saying he would never testify against the president.

Mr. Trump’s latest Twitter fusillade came after Mr. Cohen pleaded guilty to lying to Congress about the duration of his work for the Trump Organization on a proposed, but never completed, Trump Tower project in Moscow.

In reality, Mr. Cohen testified, the work on the proposal did not end in January 2016, as he had claimed, but lasted until May 2016, when Mr. Trump clinched the Republican nomination for president. The charge was brought by the special counsel, Robert S. Mueller III, who is investigating possible collusion between Mr. Trump’s campaign and Russian officials interfering in the presidential election.

In his plea agreement, and in a presentencing memo written by his lawyers in a separate federal case in the Southern District of New York, Mr. Cohen said that he had kept Mr. Trump updated about the project as he tried to expedite the proposal. During the early months of 2016, Mr. Trump had been publicly pushing for warmer relations with Russia, a position that might have benefited his business.