Superintendent Larry Johnson's resignation will take effect April 30, under a settlement agreement between Johnson and the Darrington School Board.
The agreement also ends all litigation between the superintendent and the school district, said Darrington School Board spokesman Alan Pickard.
"The board believes that this settlement, Mr. Johnson's resignation and the termination of all litigation is in the best interests of the district and the community," Pickard said.
"Further litigation would involve significant risk of liability, costly attorney fees and further heartache in a situation that began with tragedy and in which there are no winners."
Johnson was fired by the district after finance manager Myra Lewis collapsed of a cocaine overdose in Johnson's home in October 2010. She died soon afterward at an Everett hospital.
But in March, a hearing officer ruled that Johnson should be reinstated to his job, because the district did not establish sufficient cause for termination.
That ruling outraged many parents of students in the school district, and many had threatened to pull their children from school if Johnson did not leave.
Police eventually cleared Johnson of all criminal wrongdoing, but a district investigation found that he had a romantic relationship with Lewis - even though he was married.
The board then voted unanimously to keep Johnson on paid administrative leave, pending the outcome of a Superior Court case in which Johnson challenged his firing and the termination of his contract. The agreement reached this week ends that case.
The settlement includes a payment to Johnson, including payment of his attorney fees in the termination appeal, as ordered by the hearing officer.
"Although some may not agree with the outcome, the district received a fair hearing and the final decision has been made," Pickard said in a prepared statement.
The settlement also includes a buyout of Johnson's contract, to avoid legal risks to the district. The exact dollar amounts of the buyout and settlement have not been reached.
"The board believes the settlement is fair and reasonable and has been recommended by our counsel," Pickard said.
Although the settlement will mostly be paid with school district funds, the district's insurer has agreed to make a contribution to the settlement.