President Trump tweeted on Wednesday that Rep. Alexandria Ocasio-Cortez, D-N.Y., was right in saying the Department of Veterans Affairs is not the broken agency it once was. But he said it is because of his leadership.

"Rep. Alexandria Ocasio-Cortez is correct, the VA is not broken, it is doing great. But that is only because of the Trump Administration. We got Veterans Choice & Accountability passed," he said.

He then quoted Dan Caldwell, executive director of Concerned Veterans for America, saying, “President Trump deserves a lot of credit.” It wasn't immediately clear if and when Caldwell made the comment.

Trump's tweet comes after Ocasio-Cortez defended the department during a town hall in her district.

"If it ain't broke, don't fix it," she said, adding the VA provides "some of the highest quality" healthcare to veterans. She went on to criticize people who advocate to privatize the VA.

"Here's the thing, they are trying to fix it. But who are they are trying to fix it for, is the question we gotta ask ...They are trying to fix the VA for pharmaceutical companies, they are trying to fix the VA for insurance corporations, and, ultimately, they are trying to fix the VA for a for-profit healthcare industry that does not put people or veterans first," she said.

[Opinion: AOC praises chronically dysfunctional VA]