Two British extremists have been sentenced to prison after they left Britain without authorization and were stopped on a train in Hungary.

Simon Keeler and Trevor Brooks, who were previously convicted and imprisoned for terrorism offenses, were deported back to Britain after they were found on a train headed to Romania's capital Bucharest in November.

British counter-terrorism police said the pair left the country without notifying police as required. They say it wasn't clear why they were travelling across Hungary, though police were concerned they may have been trying to get to Syria.

The two men, both from London, earlier pleaded guilty to breaching the Terrorism Act. They were each sentenced to two years in prison at a London court Friday.