"We would not be here for today's signing ceremony without the dedicated efforts without the dedicated members of Congress who worked so hard to pass the National Defense Authorization Act," Trump said, namechecking Republican members of Congress including Rep. Elise Stefanik, who spoke briefly and represents the district containing Fort Drum, as well as Don Baker, Dan Donovan, Joe Wilson and Martha McSally.

Trump, who did not serve in the military himself, has previously attacked
McCain's record of service, saying the Vietnam veteran and former prisoner of war is "not a war hero" because he was captured.

"He is not a war hero," Trump told pollster Frank Luntz, who was hosting a July 2015 question-and-answer session at the Family Leadership Summit in Ames, Iowa.

"He is a war hero," Luntz interjected.

"He is a war hero because he was captured?" Trump said, cutting him off. "I like people that weren't captured, OK? I hate to tell you. He is a war hero because he was captured. OK, you can have -- I believe perhaps he is a war hero."

McCain has been one of the administration's most outspoken Republican critics.

The President hasn't backed down on his attacks on McCain, who was diagnosed with glioblastoma, a rare brain cancer, over a year ago. Trump has referenced McCain several times on the campaign trail over the past months without directly naming him, hitting the Arizona senator for his health care vote.

Just hours after the signing ceremony, Trump continued the criticism at a campaign event for Rep. Claudia Tenney in Utica, New York.

"One of our wonderful senators said 'thumbs down' at two o'clock in the morning," he said.

Although Trump claimed the Senate was one vote away, in reality, the vote was only to go to conference with the House on the Senate's "skinny repeal."

John McCain, who is the Senate Armed Services Committee chairman, spearheaded efforts to pass the defense spending bill in the Senate.

"I am particularly humbled that my colleagues chose to designate legislation of such importance in my name. Serving on the Senate Armed Services Committee has been an incredibly meaningful experience since my first days on Capitol Hill," McCain said in a press release when the bill was passed earlier this month.

The bill's formal name is the "John S. McCain National Defense Authorization Act for Fiscal Year 2019," and it is listed on the White House daily guidance as such, but Trump simply called it the "National Defense Authorization Act" at Fort Drum.

In mostly scripted remarks Monday, Trump called the measure "the most significant investment in our military in our war fighters in modern history," saying he was "very proud to be a big, big part of it."

He also touted the $716 billion in forthcoming 2019 fiscal year military funding, his administration's economic success, and the United States' "leadership in space."