WASHINGTON—The biggest push in nearly two decades to restrict firearms in the U.S., touched off by the emotional response to December's mass shooting of schoolchildren, collapsed in the Senate on Wednesday, scuttling a major element of President Barack Obama's second-term agenda.

The centerpiece of a Democrat-led gun-control effort—a plan to expand the system of background checks aimed at detecting buyers ineligible to own guns—failed in a 54-46 vote, six votes shy of the 60 needed to advance. Shortly afterward, the Senate...