Bishops meeting at the Catholic Church synod have abandoned proposals for wider acceptance of gay people which were backed by Pope Francis.
A draft report issued halfway through the meeting had called for greater openness towards homosexuals and divorced Catholics who have remarried.
But those paragraphs were not approved, and were stripped from the final text.
The report will inform further debate before the synod reconvenes in larger numbers in a year's time.
Correspondents say the text welcoming gay people and remarried Catholics had been watered down in the final version that was voted on - but it appears that they still met with resistance from conservatives.
All other parts of the draft report were accepted by the synod.
'Let God surprise'
Speaking after the vote, Pope Francis told attendees that he would have been "worried and saddened" if there had not been "animated discussions" or if "everyone had been in agreement or silent in a false and acquiescent peace", AP news agency reported.
He also cautioned against "hostile inflexibility, that is, wanting to close oneself within the written word, and not allowing oneself to be surprised by God".
While the earlier draft had said that homosexuals had "gifts and qualities to offer to the Christian community", the revised document only said that discrimination against gay people "is to be avoided".
The Pope said the full draft document, including the rejected paragraphs, should be published.
"Keep in mind this is not a magisterial document….the Pope asked for it to be made available to show the degree of maturity that has taken place and that which still needs to take place in discussions over the coming year," Holy See press officer Tom Rosica said on Vatican Radio.
The two-week synod has revealed a fracture line in church opinion over how to adapt traditional church teaching on human sexuality towards 21st-Century attitudes, says the BBC's David Willey in Rome.
Pope Francis had made a powerful appeal to traditionalists not to lock themselves within the letter of the law, but conservative cardinals and bishops carried the day at the end of the synod, our correspondent adds.
Analysis: David Willey, BBC Vatican correspondent
Voting figures for the final document at the end of the synod show that Pope Francis received a rebuff in his attempt to persuade Church leaders to support his more merciful attitudes towards gay and divorced people. However, more than half still voted in favour of his proposed reforms.
Three crucial paragraphs in the final document all received more than 50% of the vote, although they failed to get the necessary two-thirds majority.
This allows the necessary leeway for further discussion before the synod reconvenes in Rome in an expanded form in a year's time.
Paragraph 55 of the final report, which has been rewritten many times during the past week, insists that although there can be no analogy between same-sex unions and marriage between a man and a woman, "men and women with homosexual tendencies must be welcomed with respect and delicacy".
About 200 bishops attended the synod on family issues at the Vatican.
The New Ways Ministry, a Catholic gay-rights group, said it was "very disappointing that the synod's final report did not retain the gracious welcome to lesbian and gay people that the draft of the report included".
'New language needed'
Christopher Lamb, from British Catholic journal The Tablet, told the BBC that the discussion at the synod was "a huge achievement in itself".
He said it was important to remember that many of the bishops at the synod were from countries where homosexuality is illegal.
"We have now got an acceptance that we need a new language in the Church when talking about gay couples and homosexuality in general," he added.
Conservative groups had described the earlier draft as a "betrayal".
Cardinal Wilfrid Fox Napier of South Africa told Vatican radio on Friday that "there were two issues that got people 'hot around the collar'. One was presenting homosexual unions as if they were a very positive thing."
The second issue related to broken marriages "and the fact that people should be facilitated to get access to the sacraments", he added.
Correction 6 March 2015: The headline and introduction of this report have been amended to remove the suggestion that the synod's decision represented a setback for the Pope.