new york — former police sergeants benevolent association president ed mullins filed for retirement after being stripped of his gun and shield wednesday, one day after the fbi raided the union’s headquarters and his long island home.

a source said the federal investigation centered on suspected misuse of union funds. the sergeants benevolent association cannot provide an attorney for mullins because the firebrand sergeant is being investigated for stealing from the union, sources said.

police commissioner dermot shea said the mullins probe began as a joint effort between the feds and nypd internal affairs.

“the nypd internal affairs bureau and the fbi work jointly on a task force. as a result of that work, you saw some of the investigative powers being exercised yesterday,” shea said at a morning news conference. “it is an ongoing case, and i will not comment any further.”

a police source said the investigation, which was not publicly known until the raid, had long been in the works.

“they have been building this case internally and externally for a while,” the source said.

internal affairs has been investigating mullins for his toxic tweets for more than a year. but it was unclear if mullins’ social media antics were part of the fbi investigation.

for the last several weeks, mullins had backed away from the union’s day-to-day operations and frequently traveled to florida and the west coast, one source said. it was not immediately clear if the trips factor into the fbi investigation.

a separate source said the southern district of new york’s public corruption unit is handling the mullins probe. the prominent team of federal prosecutors launched a major bribery investigation of the the upper ranks of the nypd in 2016.

an nypd spokeswoman confirmed mullins was officially on modified duty. but sources said he filed for retirement, initiating a process that requires a 30-day notice. mullins cashed in accrued vacation time, meaning he’ll likely never work another shift, the sources said.

he joined the the nypd in 1982 and became a sergeant in 1993.

the sergeants benevolent association’s executive board wrote members late tuesday that it had asked mullins to resign, citing the “uncertainty” and “severity” of the fbi probe.

but a source close to that decision said mullins wasn’t pushed out.

“the board didn’t ask mullins to resign. mullins told them to ask him to resign. it’s his board. it’s a weak board,” the source said. “he went to them and said, ‘ask me to resign.’ ”

mullins, an outspoken supporter of former president donald trump, has a well-established reputation for racist, obscene tweets slamming political leaders. he was already facing an internal nypd probe for his twitter antics, which included publicly posting the arrest record of mayor bill de blasio’s daughter.

nypd prosecutors have argued the move amounted to an “abuse of authority.”

mullins is also facing internal charges for firing off tweets calling bronx democratic rep. ritchie torres “a first-class whore” and former city health commissioner oxiris barbot “a bitch.”

mullins and his attorney could not be reached for comment.

multiple sources told the news that mullins’ successor as union president, sgt. vincent vallelong, will be “less bombastic.”

vallelong was the union’s vice president before the fbi raid and next in the line of succession, a source with knowledge of the fallout said.

“he’s a very good guy and a serious cop,” the source said. “he has a whole different style of operating. he’s less bombastic and more about business.”

vallelong joined the department in 1990 and worked in brooklyn and manhattan before becoming more involved in the union. attempts to reach him were unsuccessful.

while vallelong doesn’t have mullins’ acid tongue, he also frequently takes to twitter to lambaste de blasio and other prominent politicians — particularly city council speaker corey johnson. in april, he bashed johnson, d-manhattan, on twitter for riding the cyclone at coney island while gun violence plagued the city, posting a meme with the faces of johnson and de blasio, superimposed on teletubbies, going down a slide.

“you do realize there are many political figures throughout history that have eaten cake while the citizens suffered!” he wrote about johnson. “i would love to say what i really feel about this fraud but there is a weaselly little lt monitoring this just waiting to file a log! #unfitcory #alwayswatching.”