ALBANY — An ally of a pro-charter senator from Long Island has been booted from his $75,000-a-year patronage post in the wake of this week’s bitter legislative battle over charter schools.

The firing — officially credited to “restructuring” — was widely seen as payback for Sen. Craig Johnson’s vocal opposition to a poison-pill-laden charter school expansion plan pushed by Senate Democratic Conference Leader John Sampson.

Johnson (D-L.I.) pushed to get Robert Troiano Jr., appointed to the director’s post in the Senate’s Long Island regional office last year, after rumors that Troiano was considering a primary against him, sources said.

Troiano, who’s now a Nassau legislator, was fired Wednesday, less than 24 hours after Sampson was forced to cancel a vote on his bill for lack of votes.

A Sampson spokesman said the firing was one of six in the Senate’s regional offices this week and unrelated to the charter issue.

“Legislator Troiano’s termination was made as part of broader restructuring of our regional offices,” the spokesman, Austin Shafran, said.