Maryland's highest court has upheld the state's handgun law, affirming the conviction of a Prince George's County man for carrying a handgun in public without a permit.

In an opinion handed down Wednesday, the Maryland Court of Appeals ruled that two recent Supreme Court decisions — District of Columbia v. Heller and McDonald v. City of Chicago — don't bar Maryland from prohibiting people from carrying handguns outside their homes without a permit.

Charles F. Williams Jr. had challenged his conviction in Prince George's County Circuit Court, arguing that he purchased the gun for self-defense and the Heller and McDonald opinions established a "right of persons to keep and bear arms for lawful purposes."

But the Court of Appeals said Maryland's law is constitutional because it permits people to keep handguns in their homes.

"If the Supreme Court ... meant its holding to extend beyond home possession, it will need to say so more plainly," the Maryland court wrote.

The court also said Williams didn't have standing to challenge the permit requirement, because he had not applied for one.