In the first legal ruling of its type, a federal appeals court in Cincinnati on Thursday deemed unconstitutional a federal law that kept a Michigan man who was briefly committed to a mental institution decades ago from owning a gun.

A three-judge panel of the Sixth U.S. Circuit Court of Appeals unanimously ruled that the federal ban on gun ownership for anyone who has been “adjudicated as a mental defective or who has been committed to a mental institution” violated the Second Amendment rights of Clifford Charles Tyler, a...