Peers tonight defeated the Government on plans that churches argued would restrict their ability to deny jobs to gay people and transsexuals.
The Government insisted provisions in the Equality Bill would maintain the status quo, but church leaders, including the Archbishop of York, argued that it would create confusion.
Peers voted by 216 to 178, majority 38, to strike out a section of the Bill which campaigners argued had been too narrowly drawn.
Both sides argued that their solution would maintain the current position, which allows religious organisations to discriminate against some applicants on conscientious grounds, but the Government said the change in the Bill was needed to clarify the situation.
The Archbishop of York, the Most Reverend John Sentamu, told peers: "You may feel that many churches and other religious organisations are wrong on matters of sexual ethics.
"But, if religious freedom means anything it must mean that those are matters for the churches and other religious organisations to determine for themselves in accordance with their own convictions."
He added: "Where are the examples of actual abuses that have caused difficulties? Where are the court rulings that have shown that the law is defective? If it ain't broke, why fix it?"