ANNAPOLIS - Maryland would become one of the most restrictive states in the nation for gun ownership under a bill on its way to an expected signature from Gov. Martin O'Malley.

The Senate voted 28-19 Wednesday night to approve changes made by the House, ending the months-long fight over the bill to ban assault weapons, limit ammunition magazines to 10 rounds, require licensing and fingerprints for new handgun sales and prohibit gun ownership by the mentally ill.

The Senate also approved controversial House amendments. Those include one to prevent people from buying or owning a gun if they pleaded guilty to or were found guilty of a crime but were given probation instead of a criminal sentence.

Another would increase penalties for people who use certain restricted ammunition -- including Teflon-coated, steel, explosive and depleted-uranium bullets -- while committing crimes.

Marylanders who want to purchase an assault weapon would still be able to, as long as they submit their order before the bill's effective date of Oct. 1. Current handgun owners do not need a license to keep their pistols. They would need a license to purchase new handguns but would be exempt from the license's training provisions.

Second Amendment advocates and gun control critics were vocal throughout the entire process, with thousands of Marylanders flooding into Annapolis for public hearings and votes on the bill.

Lawmakers representing those constituents were especially vocal.

"I hate the gun bill," said Senate Minority Leader E.J. Pipkin, R-Eastern Shore.

"This may be great for political aspirations, for presidential aspirations, to pound your chest," he said, alluding to rumors that O'Malley is eyeing a run for president in 2016.

The bill was spearheaded by O'Malley and supported by legislative leaders in both chambers. Senate President Thomas V. Mike Miller Jr., D-Prince George's and Calvert counties, is an admitted gun owner who says he has an "arsenal."

"It's a compromise. It's a good bill, and I'm very glad the Senate of Maryland is moving forward on this," he said.

Late Thursday, the Senate also approved a bill to allow Prince George's County Executive Rushern Baker to take greater control over the county's school system.

Under the bill, four new voting members would be added, with the county executive appointing three and the county council appointing one. The executive would also appoint the board's chairman and vice chairman, though the latter would have to be a board member already elected by voters. Baker would also select a superintendent from a list prepared by a three-person board.

The bill was approved over the objections of Sen. C. Anthony Muse, D-Prince George's, whose amendment to gut the bill and replace it with a task force was overwhelmingly defeated.

The gun bill vote capped a vigorous lobbying campaign by O'Malley.

Maryland now joins seven other states that have toughened gun control measures after a gunman killed 26 children and educators before shooting himself at Sandy Hook Elementary School in Connecticut last December, according to the Law Center to Prevent Gun Violence. Six of those states have signed their bills into law, including New York, Colorado and Connecticut.

However, 14 states voted to weaken restrictions on gun ownership or protect gun owners' rights since the shooting. They include Virginia, which voted to make secret the names of concealed-carry permit holders.