A witness at the scene said that the man ran towards one of the gates to parliament.
London: British armed police detained a man on suspicion of having a knife after he ran, shouting, towards one of the gates of the Westminster parliament in central London on Friday.
"The man - aged in his 30s - was arrested," police said.
A witness at the scene said that the man ran towards one of the gates to parliament where a militant killed a policeman less than three months ago.
"You could tell he was suspicious, he was stood there fists clenched. He looked quite an angry geezer," Bradley Allen, 19, told Reuters.
"We got seconds down the road and they had him on the floor, pinned. Police around him, telling everyone to move back."
The incident occurred less than three months since a man drove a car into pedestrians on Westminster Bridge, and then stabbed a policeman to death in the grounds of parliament, the first of three deadly attacks in Britain which has put the security services on high alert.
Another witness near parliament on Friday told Reuters he saw police threatening to use a stun gun on the man. Pictures from the scene showed the man on the ground with an officer pointing a gun at him.
"There were about three or four policeman, one of them shouting at the crowd to get back," the witness, who declined to give their name, told Reuters.
"The guy was on the ground on his front on the pavement alongside Parliament Square. They had him on the ground and were warning they would taze (stun) him again."
Officers later put the man in the back of a police van, a Reuters reporter said. Parliament said it was aware of the incident.
The gates to parliament were closed and armed police were patrolling as usual inside the perimeter, a Reuters reporter inside the building said.
On March 22, Khalid Masood drove a car into pedestrians on Westminster Bridge, killing four people, before he ran into the grounds of parliament and stabbed a police officer to death. He was shot dead at the scene and his attack prompted a review of security around Westminster.
That attack was followed by a suicide bombing in Manchester and a similar deadly attack on London Bridge, thrusting security and policing to the fore of campaigning before last Thursday's election.
The spate of recent attacks were the deadliest in Britain since four British Islamist suicide bombers killed 52 people on the London transport system in July 2005.