Some 500 radicalised Britons are estimated to be fighting in Iraq and Syria, both of which are facing a major offensive from the Islamic State (IS) militant group.
"We will shortly be introducing our own new Counter-Terrorism Bill in the UK," Cameron said in a speech to Australia's parliament before travelling to the G20 leaders' summit in Brisbane, adding that there was "no opt-out from dealing with this".
The bill will create "new powers for police at ports to seize passports, to stop suspects travelling and to stop British nationals returning to the UK unless they do so on our terms".
There would also be "new rules to prevent airlines that don't comply with our no-fly lists or security screening measures from landing in the UK," he said.
British media reports said the legislation would block individuals from returning from Syria and Iraq to Britain for at least two years unless they comply with strict measures.
These could include being escorted back to Britain and then facing prosecution, bail-style reporting conditions and deradicalisation courses.
Border guards and airport police would also be given new powers to seize passports from those they suspect of planning to travel abroad for terrorism, the reports said.
Australia is facing a similar scenario to Britain with at least 73 of its nationals having their passports cancelled to prevent them travelling to Iraq and Syria, as concerns mount that they could return home and commit violence.
At least 71 Australians are currently fighting in the two nations, the government says. At least 15 have been killed, two of them as suicide bombers and Canberra recently passed a law criminalising travel to terror hotspots without good reason.
The new powers could cause legal wrangles over fears of civil liberty contraventions, but Cameron said they were necessary.
"We listen carefully to what the police and security services advise us," he said at a press conference.
"We think about the civil liberty implications, we think about the effect on other countries, but at the end of the day I make the choices on what I believe is necessary to keep the British public safe and I think this new power is important in that regard."
Cameron added that as well as handling the extremist threat, the root cause must be dealt with.
"It's not exclusion from the mainstream. Of course we have more to do, but we are both successful multicultural democracies where opportunities abound," he told parliament.
"And it's not foreign policy. No, the root cause of the challenge we face is the extremist narrative. So we must confront this extremism in all its forms.
"We must ban extremist preachers from our countries. We must root out extremism from our schools, universities and prisons.
"As we do so we must work with the overwhelming majority of Muslims who abhor the twisted narrative that has seduced some of our people."
Cameron acknowledged the growing problem of young Muslims being enticed by extremist material on Facebook, Twitter and other social media.
"There is a role for government in that. We must not allow the Internet to be an ungoverned space," he said.
"But there is a role for companies too. In the UK we are pushing companies to do more, including strengthening filters, improving reporting mechanisms and being more proactive in taking down this harmful material.
"We are making progress but there is further to go."
Last month, the European Union, Facebook and Twitter agreed to work together to combat online extremism and discussed steps to block gruesome beheading videos.
US Internet firms have sometimes been uneasy about blocking extremist material, seeing themselves as platforms rather than publications, and worrying about the implications for free speech, which is strongly protected under US law.
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ