Trump made his comments at a televised "commander-in-chief" forum that paired him with Democrat Hillary Clinton in separate appearances.
Moderator Matt Lauer pressed Trump about his standing on Russian President Vladimir Putin. Trump has drawn criticism for his praise for Putin as a strong leader, particularly after Moscow came under suspicion from U.S. officials as being behind the recent hacking of Democratic Party groups. Moscow has denied the allegations.
"I think I would have a very, very good relationship with Putin, and I think I would have a very, very good relationship with Russia," Trump said during the forum.
"The man has very strong control over a country. Now, it's a very different system and I don't happen to like the system, but certainly in that system he's been a leader far more than our president has been a leader," he added.
Appearing on the second half of the hour-long show, Trump quickly abandoned Lauer's entreaties to avoid attacking his opponent and focus on what he would do if elected president on Nov. 8.
The event at the Intrepid Air and Sea Museum in New York offered a prelude of how they will deal with questions on national security issues in their three upcoming presidential debates.
Asked about sexual assault cases within the U.S. military, Trump said those cases should be tried in military courts.
"You have the report of rape and nobody gets prosecuted. There are no consequences. When you, when you have somebody that does something so evil, so bad, there has to be consequences for that person. You have to go after that person. Right now nobody's doing anything. Look at the small number of results," Trump said.
Clinton defends handling of emails
Hillary Clinton has defended anew her handling of classified information as secretary of state, insisting she did not jeopardise national security by discussing the Obama administration's drone program and other sensitive matters on a personal email account.
Speaking at a televised national security forum, Clinton also defended her support for US military intervention in Libya, despite the chaos that has consumed that country since then.
The Democratic nominee urged voters to weigh her readiness to be president not based on one decision but "on the totality of my record.''
Clinton and Republican Donald Trump spoke back-to-back but not face-to-face at the forum, hosted by NBC.
The candidates also took questions from an audience of veterans and active-duty troops gathered on the decommissioned USS Intrepid, which is now a floating museum in New York.
Trump levied unusual criticism against America's military leaders, saying the generals have been "reduced to rubble'' during President Barack Obama's administration.
He also suggested he would shake up the military's top ranks if he wins in November, saying there would probably be "different generals.''
"If I win, I don't want to broadcast to the enemy exactly what my plan is''
Trump remained persistently vague about his plans for defeating the Islamic State group, insisting that he privately has a blueprint for taking on the terror group but wanted to remain "unpredictable.''
"I have a very substantial chance of winning,'' he said.
"If I win, I don't want to broadcast to the enemy exactly what my plan is.''
By virtue of a coin flip, Clinton took the stage first. She quickly faced a barrage of questions about her email use at the State Department, where she used a personal email address and a private server.
The FBI found that some emails sent or received by Clinton contained classified information, but Director James Comey did not recommend she face prosecution. According to notes released from Clinton's interview with the FBI, she said she relied on others with knowledge about handling classified files.
Clinton drew an implicit contrast with Trump when asked for the most important quality a commander in chief must possess.
"Steadiness, an absolute rock steadiness, mixed with strength to make the hard decisions,'' she said.
RELATED READING
Trump promises huge military spending
Clinton has spent much of the summer trying to paint Trump as ill-prepared to be commander in chief and too unpredictable to make decisions that put American service members in harm's way. Her case has been bolstered by numerous Republican national security experts who have spoken out against their party's nominee, including former Defence Secretary William Cohen who announced his support for Clinton on Wednesday.
Clinton could also be vulnerable to Americans' worries about terrorism - particularly the Islamic State's designs on the West - and criticism that President Barack Obama hasn't done enough to combat extremism emanating from the Middle East. While she's articulated an anti-Islamic State plan that is more aggressive than Obama's, she's largely in line with the president on foreign policy.
She said she couldn't promise there would be no terror attacks on US soil if she becomes president, calling preventing terrorism "a huge challenge.''
Ahead of the forum, Trump rolled out a new plan to boost military spending by tens of billions of dollars, including major increases in the number of active troops, fighter planes, Navy ships and submarines.
Trump's address also included plans to eliminate deep spending cuts known as the "sequester'' that were enacted when Congress failed to reach a budget compromise in 2011. Republicans and Democrats voted for the automatic, across-the board cuts that affected both military and domestic programs, though the White House has long pressed Congress to lift the spending limits.
Trump expressed support for the sequester in interviews in 2013 - even describing them as too small - but seemed to suggest at the time that military spending should be exempt.
A senior adviser said ahead of the speech that Trump would make sure the additional spending was fully paid for but did not explain how.
The United States currently spends more than $US600 billion ($A782 billion) a year on the military, more than the next seven countries combined.
Even before promising a huge boost in military spending, Trump's plans to cut taxes, expand infrastructure spending and leave untouched entitlement programs such as Social Security already threaten to add trillions of dollars to the federal deficit.