BUENOS AIRES — The very idea was anathema to many of the bishops in the room.

Argentina was on the verge of approving gay marriage, and the Roman Catholic Church was desperate to stop that from happening. It would lead tens of thousands of its followers in protest on the streets of Buenos Aires and publicly condemn the proposed law, a direct threat to church teaching, as the work of the devil.

But behind the scenes, Cardinal Jorge Mario Bergoglio, who led the public charge against the measure, spoke out in a heated meeting of bishops in 2010 and advocated a highly unorthodox solution: that the church in Argentina support the idea of civil unions for gay couples.

The concession inflamed the gathering — and offers a telling insight into the leadership style he may now bring to the papacy.

Few would suggest that Cardinal Bergoglio, now Pope Francis, is anything but a stalwart who fully embraces the church’s positions on core social issues. But as he faced one of the most acute tests of his tenure as head of Argentina’s church, he showed another side as well, supporters and critics say: that of a deal maker willing to compromise and court opposing sides in the debate, detractors included.