A Palestinian activist detained on the orders of the home secretary, Theresa May, was held unlawfully and is entitled to compensation, the high court has ruled.

The decision is the latest embarrassment for the government over the case of Sheikh Raed Salah, 52, the leader of the Islamic Movement in Israel, who entered the country despite being banned.

Since his arrival on 25 June, it has emerged that no one informed him he was prohibited from coming to Britain and that a Heathrow immigration officer who scanned his passport ignored a live alert to exclude him.

Three days after entering the UK he was detained at his west London hotel, handcuffed and taken to Paddington Green police station. He had been due to address a series of public meetings, including one at the Houses of Parliament.

The home secretary subsequently served a deportation notice on him, on the grounds that his presence in the UK was "not conducive to the public good". Salah challenged his removal and obtained bail in July. He is appealing against the decision to deport him in separate proceedings before an immigration tribunal which continues next week.

In the judgment released on Friday, Mr Justice Nicol found for Salah on one of three grounds that his detention was unlawful. He rejected his claim on two other grounds.

Any compensation is likely to be small since it only covers a period of two days until the time when the Palestinian preacher was finally informed correctly why he was being detained. The judgment says immigration officers who detained him failed to ensure information was translated and failed to include the necessary details.

Earlier this week, it emerged that senior officials at the UK Border Agency had opposed the home secretary's decision to deport the Palestinian, warning that the evidence against him was disputed, open to legal challenge and the case "very finely balanced". Salah had sought damages for illegal detention, arguing in an earlier hearing that he had been "confined without lawful authority" and subjected to what was essentially "false imprisonment".

Neil Sheldon, appearing for the home secretary, had argued that she had acted reasonably and was legally entitled to order Salah's detention pending deportation. A review of his case by the chief inspector of constabulary also revealed that overseas consular staff were not monitoring Home Office immigration alerts seven days a week.

The inquiry report by Sir Denis O'Connor found "insufficiently robust processes" led to UK Border Agency staff at home and abroad, missing six separate chances to intervene overseas, at departure to, and on arrival in, Britain.

The chief inspector recommended that a criminal offence be created of an excluded person "knowingly travelling to the UK in contravention of an exclusion order".

The incident was highly embarrassing for the home secretary as the Palestinian activist was the first high-profile case under her policy of broadening the definition of "non-violent extremists" who encourage terrorism that she pledged to take pre-emptive action against.

Salah is the leader of the northern branch of the Islamic Movement in Israel, and has been imprisoned for funding Hamas and leading a violent demonstration. When the order banning him from entering the UK was issued, MPs were told the decision followed allegations of antisemitism and fundamentalist activities.