ROME — Italy’s Senate voted Thursday to grant legal recognition to civil unions, as the last holdout in Western Europe took a compromise step to give some rights to gay couples after a bitter, years-long debate.

Premier Matteo Renzi described the passage of the bill Thursday as “historic.” But gay and lesbian groups denounced the watered-down legislation as a betrayal because Renzi’s Democratic Party sacrificed a provision to allow gay adoption in order to ensure passage.

The legislation, which must still pass the lower Chamber of Deputies, is nevertheless significant for an overwhelmingly Roman Catholic country where the Vatican holds sway in politics and society, although Pope Francis remained conspicuously silent as debate raged in recent months.

The bill passed 173-71, well over the threshold necessary, after being stalled in parliament for years.