JERUSALEM — Israel's defense minister announced his resignation on Friday, saying the governing party had been taken over by "extremist and dangerous elements" and that he no longer trusted Prime Minister Benjamin Netanyahu following reports that he was to be replaced. Moshe Yaalon's departure removes a strong voice of moderation in the Cabinet and deepens the rift between the security establishment and the hardline politicians. Yaalon told reporters that "Israel is a healthy society" with a "sane majority" that is tolerant of minorities and strives for a liberal and democratic society. "But to my great dismay extremist and dangerous elements have taken over Israel, also over the Likud party, and are shaking the house and threatening to hurt its inhabitants," he said. "I fought with all my might against manifestations of extremism, violence and racism in Israeli society that threatens its sturdiness and is seeping into the army and already damaging it." Yaalon said earlier he told Netanyahu that "following his conduct in recent developments and in light of the lack of trust in him, I am resigning from the government." He added in a Facebook post, that he was also resigning from Israel's parliament and was "taking a time out from political life." Yaalon and Netanyahu have repeatedly butted heads over the role of the military in public discourse. Netanyahu was enraged earlier this month when a senior officer made public comments viewed as critical of the government, while Yaalon backed the general's right to freely express his views. Related: Netanyahu Rebukes general Over Holocaust Comments Yaalon said he always put Israel's security and other interests above his own, but "unfortunately I found myself lately in tough disputes over moral and professional issues with the prime minister and several ministers and members of parliament." Tensions between Yaalon and Netanyahu escalated in March, when military leaders criticized a soldier who was caught on video fatally shooting an already-wounded Palestinian attacker. The solider is now on trial for manslaughter. While Yaalon has backed the military, hard-liners have backed the soldier. Reports over the past few days indicate that Netanyahu intends to appoint former foreign minister Avigdor Lieberman to the post of defense minister. Lieberman, 57, is one of the country's most polarizing politicians. Over three decades, he has at times been Netanyahu's closest ally and at other times a fierce rival. Netanyahu said he regretted Yaalon's decision and that he would have preferred him to stay on as foreign minister. The prime minister also said the political shakeup was not because of differences with Yaalon but out of the need to widen the coalition to "bring stability to Israel against the big challenges it faces." Netanyahu this week invited Lieberman's ultranationalist Yisrael Beteinu party to shore up his shaky parliamentary coalition and negotiation teams have been meeting to hammer out the details of their alliance.