No injuries were immediately reported in the shooting in the Castellane housing project, an area north of the city's old port that is rife with drug violence and gangs.
There were conflicting reports about whether officers had also been targeted by automatic gunfire. David Olivier Reverdy, a police union official, told RTL radio no officers were specifically targeted and no one was wounded.
But Samia Ghali, a senator from the region, told iTele that she spoke with the police director and was told that the gunmen were targeting police and also firing at random.
French Prime Minister Manuel Valls was due in Marseille, France's second-largest city, to talk about security and education. Reverdy said it was not clear whether there was a link between the shooting on what he described as a "drug corner" and Valls' visit.
Copyright 2015 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.