The prime minister was speaking to the BBC after Saturday's attack on Glasgow Airport was linked to the two car bombs found in London's West End on Friday.
He said: "We will not allow anyone to undermine our British way of life."
Police are now holding four people over the attack on the airport and are searching houses near Glasgow.
'Maximum damage'
The UK has moved to its highest level of terror alert - critical - after a burning car crashed into the airport and the government's emergency response unit, Cobra, is holding its fourth meeting in three days.
Mr Brown told Andrew Marr on BBC1's Sunday AM it was "clear that we are dealing, in general terms, with people who are associated with al-Qaeda."
"It's obvious that we have a group of people - not just in this country, but round the world - who're prepared at any time to inflict what they want to be maximum damage on civilians, irrespective of the religion of these people who are killed or maimed are to be," he said.
Mr Brown also praised the "magnificent work" of police and security services and the public for being vigilant and for helping prevent what could have been loss of life.
He said people still needed to be "constantly vigilant" against what was a "long-term and sustained threat".
"We have to fight it in a number of different ways - militarily, by security, by police, by intelligence," he added.
"And I think it's important to say also on a day like this - we've got to also fight it as a battle of hearts and minds.
"We've got to separate if you like those great moderate members of our community from a few extremists who wish to practise both violence and inflict maximum loss of life in the interests of a perversion of their religion."
Critical condition
Of the four people being held over the attacks, two men were arrested at Glasgow Airport, in Paisley, after their Jeep Cherokee crashed into the main doors and burst into flames.
One of the suspects suffered severe burns and was taken to the city's Royal Alexandra Hospital, where he is said to be in a critical condition.
The other two people were arrested on the M6 in Cheshire overnight.
Earlier, an eyewitness to the arrests in Cheshire, Peter Whitehead told BBC News 24 that three cars straddled the motorway and brought traffic to a halt.
"It turned out they were unmarked police cars. In front of them were a couple of other unmarked police cars and they forced a car onto the hard shoulder and got the occupants out and as far as I can see arrested them," he said.
Counter-terrorism police made the arrests hours after Strathclyde police had confirmed they were linking the attack in Glasgow with events in London.
Chief Constable Willie Rae said: "There are clearly similarities, and we can confirm that [the Glasgow attack] is being treated as a terrorist incident."
Gas cylinders
Strathclyde Police had believed he was in possession of "a suspect device", but it was later found not to be explosive.
The vehicle involved has been made safe and will be examined by forensic experts.
Two Mercedes containing petrol, gas cylinders and nails were found outside the Tiger Tiger club in London's Haymarket and a nearby street on Friday, but the devices did not detonate.
BBC home affairs correspondent Danny Shaw said the decision to raise the UK's security level to critical on Saturday reflected concern that those responsible have the capability and intent to carry out further bombings.
He said the similarities between the attacks suggested they were carried out by the same individuals or by members of the same cell.
The critical threat level, the highest one possible, indicates terror attacks are "imminent".
All flights to and from Glasgow Airport were suspended after the attack.
The airport is now operating a phased reopening and flights from Orlando and Ibiza have arrived.
And a number of other airports stepped up security, including Edinburgh, Newcastle, Birmingham, Manchester and Blackpool.
Security has also been tightened at airports across the US.
Police have been increasing patrols and security for events in London over the weekend, including the Concert for Diana at Wembley Stadium on Sunday and the ongoing Wimbledon tennis championships.