NBC News issued a correction Sunday after reporting that President Trump described Gen. Robert E. Lee as “incredible,” acknowledging that the president was referring to Gen. Ulysses S. Grant.

“An earlier tweet misidentified the general President Trump described as ‘incredible’ at a rally in Ohio,” said the network’s correction. “It was Gen. Ulysses S. Grant, not Gen. Robert E. Lee.”

Mr. Trump, who had accused NBC of twisting his remarks on purpose, responded by retweeting the post and thanking the network.

At the Friday rally, Mr. Trump said Ohio gave the nation “a general who was incredible, drank a little bit too much. You know who I’m talking about, right?”

Multiple media outlets were criticized for their coverage of Mr. Trump’s Civil War-themed remarks, reporting that he praised the Confederate general but omitting that the president’s point was to illustrate the greatness of the Union Army leader, an Ohio native.

“Robert E. Lee was a great general, and Abraham Lincoln developed a phobia,” Mr. Trump told the crowd. “He couldn’t beat Robert E. Lee. But Grant figured it out, and Grant is a great general, and Grant came from right here.”