A temporary sheriff was ''sacked'' after he made a statement to police which led to allegations of criminal conduct, a court was told yesterday.

Although a decision was eventually taken not to prosecute, the sheriff was informed that because of his ''admitted conduct'' it was not appropriate for him to continue to sit on the bench.

The case of the unnamed temporary sheriff was revealed at the High Court in Edinburgh by Solicitor General Mr Colin Boyd, QC, who provided what is probably the most frank and full public explanation so far of how temporary sheriffs are appointed and removed.

Temporary sheriffs play an increasingly prominent part in the Scottish criminal justice system and their role is being challenged by two West Lothian men who have been charged at Linlithgow Sheriff Court with assault and breach of the peace.

They claim that a hearing before a temporary sheriff is a breach of their human rights under the European Convention to a fair trial before an independent tribunal.

The argument is that a temporary sheriff, whose appointment is renewed every year, cannot be seen as independent because the job is at the mercy of the Lord Advocate, who is also in charge of the prosecution system.

The Scottish Executive intends to consult on the process of judicial appointments (including sheriffs) but, for the time being, the situation is the same as it had been for some years.

Mr Boyd explained that ''temps'' were introduced in 1971, and their use and significance for the Scottish justice system had increased over the years.

In 1985, Scotland had 88 permanent sheriffs and 61 temps. Today the numbers were 110 and 129. Temps did all kinds of criminal and civil work, mainly less serious criminal cases. In 1989 to 1990 their proportion of work was about 18% of the total, last year it was just under 25%.

Jobs for temps were advertised in the Scots Law Times and the Lord Advocate drew up a list of candidates to be interviewed. These were carried out jointly by a sheriff principal and a sheriff.

Reports on the interviews were sent to officials of the Scottish Justice Department and forwarded to the Lord Advocate, who then discussed the names with the Lord President of the Court of Session.

Mr Boyd added: ''I am advised that the present Lord Advocate places great store on the advice of the Lord President. He has not made an appointment in the face of opposition from the Lord President.''

The current Lord Advocate had appointed 58 temps. They held a commission which was renewable every year until they reached the age of 65. In practice, reappointment each year was virtually automatic.

However, that might not happen if there were doubts about his or her fitness for office.

Mr Boyd said he had been instructed by the Lord Advocate to give some details of examples where a reappointment had not been made.

''There was one case where a person holding a temporary commission made statements to a police officer that raised allegations of criminal conduct by the temporary sheriff.

''Crown counsel decided not to prosecute but an official on behalf of the Lord Advocate wrote to the temporary sheriff to the effect that in view of his admitted conduct it was not thought appropriate to continue to use him as a temporary sheriff.''

The individual concerned had challenged that decision but was unsuccessful.

Mr Boyd added that two other temps had been removed because of proceedings against them by the Department of Trade and Industry over their disqualification as company directors.

The broad test applied by the Lord Advocate was whether the person was fit to continue as a temporary sheriff.

The case is expected to last at least three days, with a written decision by the court at a later date.