Donald Trump and former House speaker Newt Gingrich share the stage during a campaign rally in Cincinnati on July 6. (AP Photo/John Minchillo)

Newt Gingrich, the former speaker of the House and a close adviser to Donald Trump, broke with the Republican nominee on Thursday and endorsed Sen. John McCain (R-Ariz.) for reelection.

"I strongly endorse Senator John McCain," Gingrich said in a video address released on Thursday. "A genuine American hero, a man who has endured a great deal for his country, and a man who I work with and watch him provide leadership as chairman of the Armed Services Committee. I know how hard John works for veterans, for the military, for our national security -- and I know that John McCain is a national treasure. Somebody who’s making a real difference, a man of great courage, who is a patriot, serves his country without fear. I hope you do everything you can to make sure that Senator John McCain continues to work in Washington on your behalf, and on the behalf of all Americans."

Trump has repeatedly accused McCain of not doing enough to help military veterans, even though McCain has played a key role in a series of reforms aimed at helping veterans. Last summer Trump said that McCain is only considered "a war hero because he was captured" while fighting in North Vietnam and held as a prisoner of war for more than five years. Even after McCain endorsed Trump, the businessman has continued to question McCain's commitment to veterans.

Trump angered party leaders this week by refusing to endorse McCain or House Speaker Paul D. Ryan (R-Wis.) in their Republican primaries. Both have endorsed Trump but have remained critical of many of his comments, including his attacks on the Muslim parents of a fallen solider who spoke at the Democratic National Convention. On Wednesday, Trump's running mate, Indiana Gov. Mike Pence, said that he "strongly" endorses Ryan. Gingrich's endorsement of McCain on Thursday seemed to be a continuation of Trump's closest allies showing their support.

McCain said in a statement on Thursday that he is "honored to receive the endorsement of Speaker Gingrich, a long-time friend and leader in the Republican Party" who is also "a strong voice for conservative principles."