JERUSALEM — In a sharp turnaround, Prime Minister Benjamin Netanyahu sought on Wednesday to bring the ultranationalist Yisrael Beiteinu party into his governing coalition by offering to name its leader, Avigdor Lieberman, defense minister, according to politicians across Israel’s political map.

An Israeli government official confirmed that Mr. Netanyahu and Mr. Lieberman had met and formed negotiating teams with the aim of reaching a coalition deal “in the coming days.”

Just hours before meeting Mr. Lieberman, Mr. Netanyahu seemed to have been closing in on a coalition agreement with Isaac Herzog, the leader of the center-left Zionist Union and the head of the opposition in the Knesset, or Israeli parliament. After days of intense back-room negotiations, Mr. Herzog, whose party advocates accommodation with the Palestinians, had been expected to serve as foreign minister, an appointment that was partly intended to ease international pressure on Israel.

By contrast, Mr. Lieberman, 57, foreign minister in two previous governments led by Mr. Netanyahu, is known as a blunt-talking, polarizing figure. He demands the death penalty for Palestinians convicted of acts of terrorism; has called in the past for the toppling of Hamas, the Islamic militant group that controls Gaza; and once suggested that Israel could bomb the Aswan Dam in any future military confrontation with Egypt. Israel signed a peace treaty with Egypt in 1979.