A gay son of an Indian immigrant is now all but certain to become the next prime minister of Ireland, a country that has rapidly been leaving its conservative Roman Catholic social traditions behind.

Leo Varadkar, who was chosen Friday by the Fine Gael party to be its leader, and therefore the head of the center-right governing coalition, will be the first openly gay taoiseach (as Ireland’s prime minister is called), and, at 38, the youngest. He succeeds Enda Kenny, who is stepping down.

Varadkar’s rapid rise to the country’s highest political office, only 10 years after he entered Parliament, owes much to a willingness to speak his mind, a novelty in the normally cautious world of Irish politics.

Though in some ways he is emblematic of Ireland’s transition to a more liberal society, Varadkar presents himself as conservative on issues like the economy and law and order. As he was campaigning for the party leadership, he used his Cabinet position as minister for social protection to start a high-profile campaign against welfare fraud, which was seen as a gesture to appeal to Fine Gael’s right-wing supporters.

He also surprised his liberal admirers by reaching out to the party’s anti-abortion faction, saying that Fine Gael “should be a warm house for those who have socially conservative views.”

In 2015, Varadkar was widely praised for bravery and honesty when he said publicly that he was gay, the first Irish government minister to do so. At the time, Irish voters were debating a proposed constitutional amendment to permit same-sex marriage, and his stand is credited with bolstering the successful “yes” campaign, making Ireland the first country to legalize gay marriage by popular vote.

Varadkar was born in Dublin in 1979, the son of an Irish Catholic nurse from County Waterford and a Hindu doctor from Mumbai, India. His parents met in England in the 1960s and lived in India for a time before moving to Ireland.

Growing up in a country where religious divisions have historically run deep, he attended a Catholic elementary school and a Protestant high school that followed the Church of Ireland tradition. He told The Irish Times in 2015 that he was raised Catholic but was “not a particularly religious person.”

Varadkar trained as a doctor — a general practitioner — and became involved in politics while still in medical school. He developed a reputation as an intelligent, hardworking and articulate city councillor in Dublin, won a parliamentary seat in the Dublin West constituency at the age of 28, and rose swiftly in party circles.

Kenny, the outgoing premier, announced his retirement May 17 after being weakened by a scandal over his government’s handling of police corruption. He gave up the party leadership immediately, but said he would stay on as caretaker prime minister until the next sitting of the Dail, as the lower house of Parliament is known, this month.

Though the Fine Gael party and its allies have the largest bloc of seats in Parliament, they do not command a majority. Even so, opposition parties are not expected to block Varadkar’s formal election as prime minister by the Dail. To do so would trigger a general election, which none of the major parties want right now.

Varadkar clinched the Fine Gael leadership Friday by defeating his only rival, Simon Coveney, a fellow Cabinet minister, in an internal party election. Though Coveney received more votes from rank-and-file members, Varadkar had greater support among Fine Gael’s members of Parliament. Under the party’s weighted voting rules, that made Varadkar the winner.

A habit of speaking out on issues outside his ministerial responsibilities has sometimes embroiled Varadkar in controversy. In 2011, six months after Ireland was pressured into accepting a bailout of 85 billion euros by the European Union (about $122 billion), he claimed (incorrectly, as it turned out) that a second bailout might soon be necessary. His comment caused consternation among colleagues in the government who were trying to persuade the world that Ireland had finally stabilized itself after the banking and housing crash of 2008.

Varadkar was accused of racism in 2008 after he suggested in the Dail that unemployed immigrants should be paid to leave the country. He denied the accusation and said he was talking about a voluntary program, not forced deportation.

He is unlikely to enjoy a long political honeymoon. His party’s chief rival, Fianna Fail — also center-right — can bring down the government and force a general election whenever it feels the moment is advantageous. It does not seem advantageous now: The two parties are running close in most opinion polls, with, if anything, a narrow lead for Fine Gael.

Meanwhile, the government faces a number of serious domestic issues that could blow up into crises, including the troubled public health service; soaring rents and housing prices; anger at rising economic inequality; an interlocking nest of church-and-state questions; and slumping police morale and discipline.

Threats by the Trump administration to crack down on American multinational companies that base themselves overseas for tax reasons are also a grave concern for Ireland, which uses low corporate tax rates to entice companies like Apple, Facebook, Google and Twitter to process their cash flows through Dublin.

Loading... Loading... Loading... Loading... Loading... Loading...

By far the biggest menace on the Irish horizon, however, is Britain’s looming withdrawal from the European Union, or Brexit, which threatens to stir divisions within and between the Republic of Ireland and British-ruled Northern Ireland, where decades of sectarian struggle largely subsided after the Good Friday Agreement of 1998.

Brexit will also severely disrupt Ireland’s close business links with Britain, its largest trading partner, by removing Britain from the European single market and customs union while Ireland remains.

During the leadership campaign. Varadkar said he did not plan to appoint a special “minister for Brexit,” suggesting that he intended to deal with the matter himself. If so, he is likely to be consumed by it from his first day in office.