A Muslim with close links to a controversial organisation branded as terrorist, has fought off an attempt to oust him from control of the Scottish mosque he founded.

Opponents of Abdul Hamid claimed he was misusing trust funds to benefit Sipah-e-Sahaba, whose founder was assassinated in Pakistan, but a judge has ruled there is no basis for the allegation.

Mr Hamid, who can recite the Koran from memory, was also given a series of glowing references from leading Muslims who praised his integrity and service to Islam.

The dispute over the Islamic Studies Centre in Temple Park Crescent, Edinburgh (also known as Polwarth Mosque), was heard at the Court of Session, where Lord Nimmo Smith was asked to remove Mr Hamid from the board of trustees.

The judge said that Mr Hamid was the UK President of Sipah-e-Sahaba and the main allegation against him was that he had misapplied trust funds to further the interests of that organisation.

The judge said: ''Sipah-e-Sahaba is an organisation founded by Abu Rehan Zia-ur Reham Farooqi, who has since been assassinated in Pakistan.

''There was some evidence that it is regarded in Pakistan as being a terrorist organisation. In the United Kingdom it is a legal organisation and is active in a number of ways, such as the holding of meetings and the raising of funds.

''Abdul Hamid has been involved with it for many years and, since 1991, has been its United Kingdom president.''

Lord Nimmo Smith said Mr Hamid was called Hafiz, which signified that he could recite the Koran from memory. Born around 1952, he arrived in Rochdale in 1968 and, because of his knowledge of the Koran, was asked by colleagues to give them religious instruction.

He moved to Scotland around 1973 and is apparently a moderately prosperous member of the Muslim business community in Edinburgh. He acquired a reputation as a teacher of Islam and founded the Islamic Studies Centre, in Temple Park Crescent, in 1986.

There was a dispute in 1995, when about 20 worshippers stopped attending the mosque. Two, Mr Mohammed Shariff and Mr Syed Kirmani, petitioned the court to have the trustees, including Mr Hamid, removed.

Lord Nimmo Smith said: ''I think Abdul Hamid can properly be described as a fervent Muslim. He has an uncompromising attitude to religious affairs and has difficulty in accepting any point of view but his own.''

It was easy to see how these characteristics could antagonise others.

However, a number of written testimonials had been produced from Muslims of high standing which spoke of Mr Hamid's integrity, standing in the Muslim community and services to the cause of Islam.

One came from Mufti Maqbool Ahmed, Imam and Khateeb at the Glasgow Central Mosque, whose status was such that any pronouncement by him was held in particular regard by Muslims.

The principal complaint against Mr Hamid was that funds were misapplied to benefit Sipah-e-Sahaba, but the judge said there was no foundation for that allegation.

Mr Farooqi had been inivited by Abdul Hamid to speak at the Polwarth Mosque and a collection was taken expressly for the Sipah-e-Sahaba Welfare Trust, which helped poor people in Pakistan.

The judge said the 100 people who attended were well aware of the purpose of the collection.

He had also heard evidence that sometime in 1995, a number of leaflets appeared at the Polwarth Mosque.

''The content of the leaflet was inflammatory and included a picture of a Kalashnikov rife and the words ''Shia Kafir'' (a term of abuse). I accept that such leaflets were found on the premises.

''I do not accept, however, that Abdul Hamid or any other trustee had anything to do with them. It seems to me more likely part of a crude attempt by Abdul Hamid's enemies to discredit him.''

Lord Nimmo Smith said he did not wish it to be inferred that he suspected the two men seeking to have Mr Hamid removed as a trustee.

The question was whether they had established corrupt behaviour in a position of trust on Mr Hamid's part.

''I am satisfied that the facts established fall far short of that.''