Janet Shepherd, 56, had been working with the organisation for more than 17 years and was leading the Scottish wing before she resigned in January last year.

She claims chief executive Peter Westgarth took an instant dislike to her when he took control of the UK operation in 2005 and forced her out.

Ms Shepherd claims he was “disparaging” about her management style and asked her to leave the charity. She said he made things so difficult for her that she had no choice but to resign.

The former high school teacher then filed a claim of unfair dismissal and breach of contract against the Duke of Edinburgh Award.

She told the hearing before employment judge Susan Craig that following her resignation HRH Prince Philip had sent her a personal letter of thanks for her dedication over the years.

Ms Shepherd said: “I felt there was a relationship problem and tensions between the UK operation and the Scottish office.

“I felt as though Mr Westgarth was being unprofessional towards me. He was disparaging and he really didn’t listen to me. It was defiantly bordering on harassment and I got the feeling he was trying to get rid of me.”

Ms Shepherd said that her problems with Mr Westgarth came to a head during a dinner meeting on July 3, 2007, just hours after she escorted Prince Philip around Holyrood Palace as he handed out Gold Duke of Edinburgh Awards. She said: “He asked me to leave and I said no.”

Ms Shepherd was then involved in a skiing accident and had to take around three months’ sick leave with a broken arm. She said when she returned Mr Westgarth began raising issues over her “management style” and the reasons behind her assistant resigning. And in December 2007 Ms Shepherd took further sick leave, this time citing “work-related stress” for her absence. She resigned the next month without returning to work and her former assistant took her job.

A colleague-based appraisal of Mr Westgarth showed Ms Shepherd had accused him of being a bully and at an employment tribunal in Edinburgh last week he admitted that she had always met, and exceeded, targets.

In the letter sent to her by Prince Philip following her resignation, he expressed his upset at her leaving.

It read: “I’m very sorry to hear that you will be leaving the award in Scotland after 15 ‘action-packed’ years.

“The award in Scotland has made impressive progress in recent years which reflects your commitment and hard work. I just wanted you to know how much your dedication is appreciated and wish you well for the future.” The note is signed, “Yours Sincerely, Philip”.

Giving evidence to the tribunal, Mr Westgarth said colleagues had described Ms Shepherd as “pig-headed” and difficult to work for.

He said that Ms Shepherd had told him that she had been applying for other jobs and described as “challenging” his working relationship with her.

He said: “Fairly early on in my time at the organisation she expressed that it was time to leave and that she had applied for other jobs.

“It was a business colleague-manager relationship. Sometimes it was a lot of fun, sometimes challenging, but always positive about the job we had to do together.”

Mr Westgarth denied that he had asked Ms Shepherd to leave and said he had hoped that she would stay on as Scottish director. But he said he was forced to act after her assistant, Barry Fisher, resigned.

Mr Westgarth said: “He said it was because his relationship with Janet was untenable.”

The tribunal continues.