LONDON — Three people have been arrested in a 24-hour period in Wales in connection with the terrorist attack at a London Tube station that briefly sowed panic on the city’s transport system last week, the police said on Wednesday, bringing the number of people in custody to five.

Scotland Yard said two men, ages 48 and 30, were arrested on Wednesday under counterterrorism laws in Newport, a university city in southeast Wales not far from Cardiff, as part of the investigation into the attack that injured at least 30 people.

The arrests came a day after the police said they had detained a 25-year-old man in Wales over the attack, the fifth major assault in Britain this year and the fourth in London.

The Islamic State militant group said after the attack that a “detachment” of its fighters had been behind it. The authorities are trying to piece together the events leading up to the bombing, to ascertain whether those involved had been influenced by extremists, and whether they had acted alone or were part of a wider network.