LONDON — A man arrested outside Buckingham Palace on Friday night had deliberately driven his blue Toyota Prius at a police van, attempted to pull out a four-foot sword and repeatedly shouted “Allahu akbar,” the London police said in a statement on Saturday that added fresh details about the episode.

The police identified the man, who is in custody, only as a 26-year-old from Luton, a town about 30 miles northwest of London.

An investigation will look into whether the assault was a terrorist attack, the police said.

Counterterrorism investigators believe he acted alone, the police said. But they searched the Luton area on Saturday to try to learn more about the man, who is in custody.

Britain has suffered a number of terrorism-related attacks this year, including a deadly assault in June, when three Islamist extremists drove a van into pedestrians on London Bridge and then used knives to attack people in an area with bars and restaurants.