SENIOR members of the Church of Scotland have voted to let some congregations choose ministers who are in same-sex relationships - an important compromise that must still pass further hurdles before it can become church law.

The church's General Assembly on Monday backed a motion affirming a traditional conservative view on homosexuality, but permitted liberal congregations to ordain openly gay men or women if they wish.

The assembly's vote would require the approval of next year's General Assembly as well as votes by the church's regional presbyteries to become law. The process is complicated, and is expected to take at least two years.

Monday's decision came after a lengthy debate on the issue, which has divided the church of about 400,000 members for years. Two congregations have split from the church over the issue.

"This was a major breakthrough for the church but we are conscious that some people remain pained, anxious, worried and hurt," said Lorna Hood, the assembly's moderator.

"We continue to pray for the peace and unity of the church."

Albert Bogle, who proposed the motion, said it was a compromise to move the debate between the traditionalists and revisionists forward.

"My motion is to be permissive and to allow those who want to do this to do it. But I want to affirm the position of the Church of Scotland in the historic tradition of the church," he said. "It will give everyone what they want but it will keep us together."

The General Assembly, held each May, consists of about 700 members and decides church policy.