Story highlights

The two men were questioned by counter-terrorism officers

They are both British nationals from Cardiff, Wales

The pair were initially arrested in Kenya on Sunday

London CNN  — 

Two 18-year-old men questioned under anti-terrorism legislation after arriving in Britain from Kenya, where they were initially arrested, were released Thursday, police said.

The pair, both from Cardiff in Wales, had been held under a provision of the Terrorism Act 2000 on their arrival at London’s Heathrow Airport on Wednesday afternoon.

South Wales Police said in a statement the men had been questioned at the airport by officers from the Wales Extremism and Counter Terrorism Unit. London’s Metropolitan Police Service was also involved, police said.

Officers from South Wales Police are continuing to work with the families of the two teenagers and with the Kenyan authorities, the statement said.

The men were arrested in Kenya on Sunday and put on a plane back to Britain Wednesday.

CNN’s Per Nyberg contributed to this report.