The Lord President, Scotland's most senior judge, appeared for the first time before MSPs yesterday and made a strong plea for the judiciary's independence from government to be enshrined in law.

Welcoming Lord Hamilton to the justice committee, convener Bill Aitken said it was a unique occasion as he could find no precedent for the Lord President addressing a parliamentary committee.

The country's top judge gave evidence on the Judiciary and Courts (Scotland) Bill at a session which included three other judges, as well as sheriffs, advocates, solicitors and representatives of the Judicial Appointments Board.

Lord Hamilton was one of several senior legal figures who gave their views on the Judiciary and Courts Bill.

They included fellow judges Lord Hodge, Lord Osborne, and Lord Reed, and top figures from the Law Society of Scotland and the Faculty of Advocates.

Lord Hamilton backed the intention to place a statement on judicial independence on the face of the Bill, saying: "I see it as a signal, if nothing more, that there should appear in the legislation a provision for the importance of judicial independence."

He stressed he did not envisage this principle being breached but added: "It sends out the right message. We live in pleasant times. Times may not always be pleasant, and conflicts could arise between the judiciary and the executive."

Lord Hamilton would become formal head of the system, responsible not just for the High Court, Court of Session and Court of Appeal, but also for the sheriff and district courts.

To ease the administrative burden he would be given his own separate civil service, the Scottish Courts Service, based on the model established in Dublin. Lord Hamilton stressed that he still intended to spend the majority of his time in court.

He argued that if MSPs wanted to compel anyone in future to appear before him it should be the chief executive of the SCS, not the Lord President, who could be invited to attend but should not be compelled to attend, again as a bulwark for the independence of the post from political control.

Similarly, there was disagreement about the planned composition of the Judicial Appointment Board. He believed that, on another point of principle, those appointed by the Government should be in a minority, with either a majority for the judiciary or a casting vote in the hands of the Lord President. Most witnesses were broadly happy with the Bill, but Lord Hamilton rejected a suggestion that training for judges should be made mandatory in law. He told MSPs that he had responsibility in the Bill for putting in place the arrangements for the training of judges.

"It's a question of finding the right way of securing the ultimate end," he said, adding that his experience indicated that the best way of securing attendance of senior judicial office holders at training events was through encouragement.

"There are dangers if one uses the stick too much rather than the carrot. I would say that a judicial office holder is going to be much better able to receive training if he or she has been encouraged that it is a good thing to go there, rather than by two policemen marching him or her to the appropriate place.

"I would say that the better arrangement is to leave matters to me to put in place appropriate arrangements. If it is necessary then the arrangements could include matters which verge on compulsion, but I would hope it would not come to that."

He also said that, in terms of a complaints system against judges and sheriffs, there were already steps in place through the Judicial Council for Scotland to draw up a Code of Judicial Guidance, a list encouraging good practice rather than a "penal code of misconduct".

He made one other appeal to MSPs regarding judicial appointments. He wanted to encourage a system similar to that of Recorders south of the border, part-time judges bringing expertise to the Bench without seeking to become full-time judges.

It was envisaged that these would have to go through the Judicial Appointments Board but he asked for flexibility on this.

"I need to be able to tap them on the shoulder to invite them onto the bench part-time and get that trend going."