ALBANY — A top aide to all-but-ousted Senate Majority Leader Malcolm Smith charged yesterday that Sen. Pedro Espada defected to the Republicans after Smith blocked his possibly illegal effort to steer $2 million in pork-barrel projects to “sham nonprofit” organizations in The Bronx.

Austin Shafran, Smith’s spokesman, claimed that only after Espada (D-Bronx) learned that he wouldn’t be getting the “member item” funding for the Bronx Human Services Council and Green ECO Energy Inc. did he join in with Monday’s GOP revolt to oust Smith.

“Two words come to mind: political extortion,” said Shafran, adding, “Malcolm prevented Espada from setting up these sham nonprofits that were essentially bilking taxpayers out of millions.”

Espada, the subject of several past and present criminal investigations, called Shafran’s claims “utter nonsense” and said, “attempts to assassinate my character won’t divert or distract us.”