President Barack Obama on Thursday said Congress’s failure to pass legislation mandating new background checks ahead of gun purchases was his “most disappointing” moment with lawmakers.

The White House and Congress have had their share of standoffs, including testy hearings over the Internal Revenue Service and Benghazi, debt-ceiling showdowns and a budget impasse that led to a partial government shutdown.

But Mr. Obama said the December 2012 massacre at Sandy Hook Elementary School was “probably the worst day of my presidency” and the failure to enact a background-check law afterward was “probably the most disappointing moment that I had with Congress.”