BROOKLYN - In an almost unanimous vote, the City Council passed a bill that allows students to carry cell phones to and from school.

The measure didn't change a long-standing ban on cell phones inside school buildings in the nation's largest school system, but it could help buttress legal challenges to the policy or help force the education department to compromise and find a solution.

It did not appear there would be an immediate compromise, however. The Department of Education said Wednesday that the policy had not changed, and a spokeswoman said Mayor Michael Bloomberg would veto the measure.

City Council Speaker Christine Quinn said the council had enough votes to override a veto. The measure passed by a vote of 46-2.

The ban on cell phones has been in place for years, but until recently students carried the devices without much consequence. When the city began random security checks as part of a crackdown on weapons, it began finding and confiscating hundreds of cell phones, which sparked a fierce battle over the policy.

Many parents say it?s important that they be able to get in touch with their children at a moment?s notice, in case of an emergency.

Associated Press wire reports contributed to this story.