District Attorney George Gascón’s deputies appear to have stepped over the line when they hosted an after-hours re-election fundraiser for the boss the other evening at Ted’s Sports Bar & Grill across from the Hall of Justice.

Seventeen prosecutors — mostly misdemeanor deputies — lent their names to the party invitation that was circulated to the rest of the office.

From what we’re told, a number of attendees felt they had no choice but to give or risk damaging their careers. The event reportedly brought in about $10,000 for Gascón’s 2015 re-election campaign.

Some of the eager deputies made a direct appeal for contributions from the 50 or so fellow prosecutors and office employees who attended the Nov. 13 gathering, an apparent violation of city and state political conduct rules.

Gascón himself was on hand at the event, and after the money pitch from a homicide deputy, he thanked the crowd for showing up to support him.

In September, City Attorney Dennis Herrera issued a 10-page memo with updated rules governing political activity, and he warned that “city officers and employees may not solicit political contributions from other city officers and employees, even while off duty.”

No sooner did we point out the the rules to Gascón’s office than his political team shot off an e-mail thanking everyone who had cut a check, but telling them that “in an abundance of caution, we are returning your contribution to assure compliance with the California Good Government Code.”

Alex Bastian , a spokesman for the D.A.’s office, referred our queries to Dan Newman of the political consulting firm SCN Strategies, which is handling Gascón’s campaign.

Newman reiterated that the contributions were being returned “out of caution” but said Gascón’s supporters “were certainly well intentioned.”

Lawyers with the city attorney’s office declined to comment.