Mayor-elect Martin J. Walsh is shooting down the plan to arm some Boston patrol officers with military-style rifles — setting up a potential showdown with the department which has backed the controversial measure, citing a need for high-powered weapons in light of school shootings and the marathon bombings.

“Mayor-elect Walsh is opposed to the AR-15 rifles,” his spokeswoman Kathryn Norton said in a short statement yesterday. “Unless otherwise convinced by the Boston Police Department, he does not think they are necessary.”

Walsh would have to approve a budget for 33 ?AR-15 rifles at a cost of $2,500 each. Police were in the planning phases of acquiring the rifles to put in the cruisers of two specially trained beat cops in each of the city’s 11 districts.

Thomas Nolan, a former BPD lieutenant and now a criminal justice professor at the State University of New York, said Walsh is making the right decision because arming beat cops with high-powered rifles is counterproductive to establishing trust with residents. He noted firing a round from an AR-15 can launch a bullet two miles.

“If the cops have these machine guns, they’re going to use them,” Nolan said. “Someone is going to get hurt, someone is going to get killed, an innocent bystander is going to get caught in the crossfire and there is going to be a tragic result,” he said.

But a veteran officer who asked not to be named said he was disappointed Walsh wouldn’t back the purchase of the AR-15s, saying the weapons are needed to make sure cops aren’t outgunned.

“It gives you at least a fighting chance if you go into something where suspects have more firepower than you,” he said.

Boston police spokesman Sgt. Mike McCarthy had said the plan to buy the guns and arm officers was in the works before the marathon bombings and was motivated by a nationwide surge in massacres such as the Sandy Hook Elementary School shooting in Newtown, Conn., when suspects are still armed and shooting.

The use of the weapons, he said, would be strictly regulated and would not be used during routine patrol. Use of the weapons could include an active-shooter incident, firing on a suspect from a distance and confronting a suspect wearing body armor.