Mr. Stevens retired from the Supreme Court in 2010. He wrote a major dissent about the Second Amendment in one of the court’s hardest-fought decisions. Mr. Stevens argued that the amendment does not protect an individual’s right to own firearms.

“That decision — which I remain convinced was wrong and certainly was debatable — has provided the N.R.A. with a propaganda weapon of immense power,” Mr. Stevens wrote on Tuesday, referring to the National Rifle Association, the powerful gun lobbying group. “Overturning that decision via a constitutional amendment to get rid of the Second Amendment would be simple and would do more to weaken the N.R.A.’s ability to stymie legislative debate and block constructive gun control legislation than any other available option.”

Sarah Huckabee Sanders, the White House press secretary, indicated the administration was not considering a repeal of the Second Amendment.

“The president and the administration still fully support the Second Amendment,” Ms. Sanders said on Tuesday in response to a question about Mr. Stevens’s Op-Ed. “We think that the focus has to remain on removing weapons from dangerous individuals, not on blocking all Americans from their constitutional rights.”

In his tweet, Mr. Trump also said that Democrats support repealing the Second Amendment, but that has not been the case in Congress, which is only considering modest policy changes on guns. In the 1990s, a Democratic congressman from New York introduced legislation for a repeal, but it did not get any traction. Mr. Trump’s opponent in the 2016 election, Hillary Clinton, did not campaign to repeal the Second Amendment.

“We can uphold Second Amendment rights while preventing senseless gun violence,” Mrs. Clinton tweeted in May 2016.

Mr. Trump had the support of the N.R.A. early in his campaign for president and has said he is “the biggest fan of the Second Amendment.” After the deadly mass shooting at Marjory Stoneman Douglas High School in Parkland, Fla., last month, Mr. Trump proposed stricter controls on access to guns, particularly raising the age to purchase an assault weapon to 21 from 18. After a meeting with the N.R.A., Mr. Trump no longer advocated for an age increase.