The embattled leader of a Maryland school system will get a contract settlement of nearly $800,000 as he leaves his job — a controversial deal that follows a string of scandals that eroded his support.

Kevin Maxwell ends his tenure as chief executive of Prince George’s County Public Schools about three years before his four-year contract is over, under terms of an agreement approved by a 7-to-2 vote of the school board Thursday night.

His severance package includes $790,000 in compensation, payout of leave time and health benefits. It covers much of what he would have collected if he had worked. His remaining contract was estimated at $1.2 million.

The tensions that flared during Maxwell’s tenure were on display as he departed. On Thursday night, some board members talked about moving on while others denounced the payout to Maxwell and the scandals that unfolded during the past five years. Maxwell completed his first four-year contract in 2017 and was then given another four-year pact.

Maxwell had sought a full payout of his salary and benefits, according to two people familiar with the discussions. His critics said he should get no severance at all.

The CEO’s contract extended until June 2021, and state law limits the circumstances under which he can be fired.

“They sold our kids down the river,” said school board member Edward Burroughs III, a frequent critic of Maxwell’s. “Basically, they’re taking money directly from the classroom in our system and they’re giving it to Dr. Maxwell.”

Maxwell has not given interviews since he announced plans to step down. He turned down another request from The Washington Post last week.

The CEO was not at the board meeting, and officials said Thursday was his last day. Monica Goldson, a deputy superintendent, was named acting CEO.

Maxwell announced May 1 that he planned to “transition” from the system following a tumultuous year that included controversies over inflated graduation rates and “excessive” pay raises to high-level aides.

Since May, Maxwell has been vague about the terms and date of his exit, and as the weeks dragged on, many in the school system and the community grew bitter about the lack of clarity.

In recent weeks, critics have demanded to know why Maxwell was owed anything if he had initiated the separation.

They argued that so much had gone wrong on Maxwell’s watch that he should not collect more money.

“Why would you buy someone out who said he was leaving?” said Theresa Mitchell Dudley, president of the teachers union. “There’s no reason for them to give him a golden parachute as he’s going out the door.”

Doris Reed, executive director of the union that represents principals and administrators, said Maxwell deserved “absolutely nothing.”

“They’re letting this man blackmail this county,” she said. “He’s cost us so much money, and then you’re going to give him more money to go away? I’ve never seen anything like it. It’s an embarrassment to Prince George’s County.”

But there were also new details of what unfolded in the spring as Maxwell announced his plans.

Segun Eubanks, chairman of the school board, acknowledged in an interview Thursday that he had asked Maxwell to leave. He declined to be specific about the timing but said it preceded Maxwell’s May 1 announcement.

“I told him I thought it would be best,” Eubanks said, noting that candidates for county executive were calling for Maxwell’s ousting.

“I did not want to see there be an ugly transition,” Eubanks said. He said he did not know if his request prompted the CEO’s departure.

School board member David Murray on Thursday called the size of the payment alarming.

“I’m surprised because it’s close to a million dollars’ severance for one man not to do his job,” he said. “But I’m also not surprised because the board for years has refused to hold Dr. Maxwell accountable.”

When Maxwell’s contract was signed, his base pay was $299,937 a year. On July 1, he drew a 3.5 percent raise. Under the contract, he was also eligible for future raises, bonuses, retirement benefits and insurance coverage.

For more than two months, Maxwell did not submit a letter of resignation or retirement, apparently seeking to preserve his negotiating position.

The delay in his departure was couched as a wish to wait until the school year ended. But it also came after the June 26 primary election, in which a huge payout to an unpopular schools chief could have been an issue with voters.

Maxwell was handpicked for the job by County Executive Rushern L Baker III, who was seeking the Democratic nomination for governor and widely viewed as vulnerable on education issues. Baker lost the election to former NAACP president Ben Jealous, who will face Gov. Larry Hogan (R) in the November general election.

Maxwell arrived in the county with a mandate to help turn around a low-performing school system, and he was popular for a time.

Maxwell was hit with two major scandals during his first term — one involving a sex abuse case that raised questions about supervision and oversight, and a second that led to the collapse of a $6.4 million federal Head Start grant.

As he began his fifth year, his troubles worsened. The school system came under fire for grade tampering to increase graduation rates and pay raises to central office employees that were unauthorized or notably high.

The pay raises appeared to be a last straw for Maxwell, with more and more calls for him to step down or be fired.