Correction: An earlier version of this article incorrectly reported how many Knesset seats were won by the Yamina party. It won seven. The article has been updated.

BEIT ARYEH-OFARIM, West Bank — Much like her country, Nirit Weinberg has been on a journey from secular to religious, from centrist to right wing.

Once a resident of Israel’s crowded coastal plain, she now lives in the hills, where her comfortable family home, set amid mango and fig trees, perches on a limestone bluff with panoramic views of Tel Aviv and the sea beyond. The schools are good, the community is tightknit and, while the Palestinians in the nearby village may seethe over what they say is stolen land, violence is rare.

And now there’s another benefit. Weinberg, a scientist and 45-year-old mother of two, says she feels a special connection to the man likely to become Israel’s next prime minister, possibly within days. He was a settler just like her. “He’s lived here in this community,” Weinberg said. “It’s very comforting.”

Naftali Bennett may, in some respects, be little different from the man he is set to replace, Benjamin Netanyahu. Both are politicians of the Israeli right, determined to take a hard line in dealing with the Palestinians and committed to their country’s inexorable expansion across land they consider the rightful home of the Jewish people.

But Bennett is also different in fundamental ways from all 11 men — and one woman — who will have preceded him as Israel’s leader. Assuming his coalition government does not fall apart before it can be sworn in, Bennett, 49, will be Israel’s first prime minister to identify as religious, rather than secular. And he will be the first to have lived in one of the Jewish settlements in the Israeli-occupied West Bank, which are illegal under international law.

While he didn’t stay for long, he is strongly associated with the settlements in Israel, having led the Yesha Council, the main settler advocacy group. He also became an outspoken advocate of Israeli annexation of parts of the West Bank — a view long regarded by many Israelis as extreme.

Bennett, however, is also a creature of Israel’s more cosmopolitan quarters. The son of immigrants from California, he is a former high-tech entrepreneur who lived in Manhattan, speaks fluent English and is married to a nonreligious high-end pastry chef.

How those contrasting identities and experiences would shape his term as prime minister are questions of acute interest this week in Israel, where the nation is trying to make sense of a career marked by its rapid rise and shifting loyalties.

Asked to describe the likely next prime minister to non-Israelis, Oded Revivi, the mayor of Efrat, a Jewish settlement south of Bethlehem and former Yesha colleague of Bennett’s, paused to consider. “You say American readers don’t know who Bennett is,” Revivi said finally. “I have to answer, neither do Israelis.”

Among Palestinians, there is relief that Netanyahu — whose tenure has been marked by dimming hopes for an independent Palestinian state — appears on his way out.

But there is also trepidation that Bennett could be even worse for Palestinians and that he reflects an ominous shift in Israeli society. In recent years, the idea that the biblical homeland of the Jews was eternally deeded to them by God has moved from the fringe to mainstream, and Bennett has ridden this religious Zionist trend to the peak of political power.

“Jewish society has gone more and more toward the religious and the settler ideology,” said Honeida Ghanim, who directs the Ramallah-based Palestinian Forum for Israeli Studies.

Benjamin Netanyahu, Israel’s prime minister, is set to be ousted by an extremely fragile and unlikely alliance of parties from across the political spectrum. (Reuters)

Bennett was born in the Israeli port city of Haifa. His parents, who were secular Jews when they immigrated from the San Francisco Bay area in the late 1960s, grew more observant over time and sent Bennett to a religious Jewish high school.

If he becomes the first prime minister to be sworn in wearing a yarmulke, in his case the small knitted skullcap that marks him as a religious Zionist, it wouldn’t be the first time he has brought a religious orientation into previously secular strongholds.

When the time had come for his military service, for example, he set his sights on one of the elite units that are often a launchpad for highflying careers in business and politics. Bennett became one of the first religious recruits in the Maglan, the super-selective commando unit that counts Netanyahu among its alumni.

“He was basically doing ambushes and raids on Hezbollah,” said Yohanan Plesner, a liberal former Knesset member who has been friends with Bennett since they served together in the unit. “You can definitely say that he knows how to stand up to pressure.”

After the army and law school at Hebrew University, Bennett founded a cybersecurity company, Cyota, and moved to New York. He and his partners sold the company in 2005, and Bennett returned to Israel, financially secure and looking for a doorway into politics.

He found one in the office of Netanyahu, then the leader of the opposition in the parliament. Bennett was hired as chief of staff. There he met a young staffer named Ayelet Shaked, who would step into a role she still plays as Bennett’s political partner.

The pair helped run Netanyahu’s campaign to lead the Likud party and then, when he was elected prime minister in 2009, moved with him to the country’s top office in Jerusalem. Bennett named his first son Yoni after Netanyahu’s war-hero brother.

But both Bennett and Shaked were fired abruptly in 2009, reportedly following run-ins with Netanyahu’s wife, Sara. Bennett’s friendship with Netanyahu was sundered, though he would later serve as a top minister in several of his former mentor’s governments.

Bennett went on to find a political platform as the director of the Yesha Council. Bennett, who lived in a tony Tel Aviv suburb, stood out from other members, mostly officials in the Jewish towns of the West Bank. But like them, he was a fierce advocate of funding, expanding and ultimately annexing the settlements into Israel.

He left the job after a year. Revivi said Bennett ran afoul of other members by trying to open a dialogue with largely left-wing protesters. “He was going to Tel Aviv and showing some sort of sympathy to the protesters, which wasn’t seen favorably by the council,” said Revivi.

As Bennett looked around for his first elected position, his eyes alighted on a mostly moribund religious party called Jewish Home. He put himself up as party chairman, won and was elected to the parliament, or Knesset. “It’s like when a businessman finds a skeleton company to take over for his own purposes,” said Plesner, who is now the president of the Israel Democracy Institute. “Likud was the natural fit for him. But Netanyahu wouldn’t let him in, so he found another way.”

Here, too, Bennett chafed against more doctrinaire elements, Plesner said. “The rabbis had a lot of influence on the base,” Plesner said. “Bennett wanted to free himself of that.”

Bennett and Shaked started yet another new party. Eventually, their efforts ended with Yamina, the party he has led since 2019. While it secured only seven Knesset seats in the most recent election, the number was large enough to make him a kingmaker in coalition negotiations and set him up to be prime minister.

Despite Bennett’s prominence, few in Beit Aryeh-Ofarim know he was once a resident. His stay was only several months and more than two decades ago, when the community was far smaller.

Today it numbers just over 5,000. That’s enough for a pair of elementary schools, one religious, the other secular. The growth is constant, and there are ambitious plans for more. Just across a rocky canyon from Weinberg’s backyard, a new road has recently been cut into the hillside. Colorful billboards advertise “the real estate deal of the year” — new, five-room apartments that cost a fraction of what they would fetch inside Israel’s internationally recognized borders.

“People in Israel understand now that it’s important to keep this place,” Weinberg said. She said whatever ambivalence the country may have felt toward settlements in the past, Israel will never give this land back. It is a view that has gained currency since the unilateral Israeli disengagement from the Gaza Strip in 2005, which was followed by the election there of the militant Islamist group Hamas and recurring rounds of hostilities with Israel. Bennett has vowed to never do the same in the West Bank.

Weinberg moved to Beit Aryeh-Ofarim for reasons both practical (“a house with a garden that’s less than 30 minutes from my parents”) and sacred (it “brings us closer to God.”) As she has become more religious and attuned to the country’s security needs, she said she has drifted away from centrist parties that advocated negotiation with Palestinians.

Weinberg, who is the local leader of the Yamina party, said Bennett’s rise is evidence of how the country’s political center of gravity has shifted.

While many in the settlement have also welcomed the idea of Bennett as prime minister, there are also reservations about how he has done it, in particular his willingness to enter a governing coalition that includes left-of-center parties and, for the first time, an Arab Islamist party.

“Once he had right-wing views. Now he’s with the Arabs,” said Yaki Alon, 53, who runs a pizza and ice cream shop that is one of the settlement’s main gathering spots. “He needs to stay with the concept of Greater Israel . . . not return our land.”

To the Palestinians living in Lubban, a village just down the hill from the settlement, return seems a remote prospect.

Alaa Abu Yaas, 34, has spent his working life behind the counter of a squat, concrete grocery store looking directly out at the red roofs and tidy lanes of Beit Aryeh-Ofarim. It is all built, he said, on a hilltop that his grandfather once owned and had long used to graze sheep, grow vegetables and harvest olives.

He was unaware that the man who will likely be Israel’s next prime minister had once lived there, and he was uninterested in what that experience might mean. There is no difference between Bennett and Netanyahu, Abu Yaas said, because they represent the same thing: continued Israeli occupation.

“I can’t have any reaction because I don’t have any power,” he said as children played outside in crumbling streets. “What can I do? Knock on the door and say, ‘You took my land?’ ”  

Hendrix reported from Jerusalem.