A school district superintendent in Idaho, who had resisted calls to leave his post, finally agreed to step down when an anonymous donor reportedly gave him $400,000 to get out.

New Plymouth Superintendent Kevin Barker agreed to resign from his position last Wednesday during a special school board meeting, the Idaho Statesman reported Monday. Barker, who was dubbed a "bully" by some critics, is accused of creating a hostile environment for teachers.

He initially didn't want to leave -- but then Barker got an offer he couldn't refuse. An anonymous third party stepped up and offered Barker $400,000 to leave, which will be paid by that individual. The money won’t come from the school district or “any public funds,” the report stated. Barker has the option to receive the money in one block or have it distributed to him through December 2020.

“Because of his connection with the schools and students the decision to resign was difficult,” Barker’s attorney, Julie Klein Fischer, told the Idaho Statesman. “Nonetheless, this change presents Mr. Barker with the ability to explore other opportunities and allows him much needed time to focus on family.”

Barker will also get a monthly salary of $1,500 for his consulting work with the school district up until June 30, 2020 – even if he gets a new job during the time. His life insurance, full family insurance benefits and retirement contributions will continue through June 2020.

The agreement also states Barker will get a letter of recommendation from the school board and be able to keep his Microsoft Surface and laptop, both of which were purchased by the district.

Trouble with Barker has been brewing since at least March, when the school board met with people who supported and opposed Barker, the Idaho Statesman reported.

“The atmosphere in the New Plymouth district has not been normal for more than a year,” one person wrote about Barker in an online survey. “As the leader of this district, I hold Mr. Barker responsible for the obvious decline in the morale of teachers and staff. We are trying so hard to stay positive for the students and serve them well but Mr. Barker’s seemingly vindictive behavior and decisions are making my and my colleague’s jobs unnecessarily difficult.”

At the time, Barker said he had no intention of leaving his position and the school board released a statement supporting him.