The 4th U.S. Circuit Court of Appeals ruled 10-4, "We have no power to extend Second Amendment protection to the weapons of war."
Judge Robert King said the only reason to have high-powered weapons such as AR-15s was to "lay waste to a battlefield full of combatants."
The opinion cited the 2008 Supreme Court case District of Columbia v. Heller, which said weapons that would be most useful to the military aren't protected under the Second Amendment.
Maryland's law bans 45 different kinds of firearms and limits magazines to 10 rounds. The measure was passed in 2013 in response to the Sandy Hook Elementary School shooting.
A National Rifle Association spokesperson said, "It is absurd to hold that the most popular rifle in America is not a protected 'arm' under the Second Amendment."