The Senate tied itself in knots this week in order to avoid offending gun owners and the National Rifle Association. Mandatory background checks for most gun purchases failed in a 54-46 vote. It needed a 60-vote supermajority to succeed. Large majorities rejected eight other amendments including a ban on military-style assault weapons and large-capacity magazines.

The leading universal background check measure, co-sponsored by West Virginia Democrat Joe Manchin and Pennsylvania Republican Pat Toomey, and supported by Arizona Republican John McCain, failed.

But — gun owners, beware — it was supported by a majority of senators.

There is a sound argument for making the National Instant Criminal Background Check System more effective, and for making sure that it is used to keep guns out of the hands of mentally disturbed people.

An amendment sponsored by S.C. Republican Lindsey Graham to address that issue garnered a majority vote, but failed to gain the required 60 votes. The senator should keep pressing the issue.

And advocates for strict limits on assault weapons and large capacity magazines should continue to press their case.

The Depression-era Federal Firearms Act made machine guns and sawed-off rifles and shotguns illegal without a license from the attorney general. Most gun owners do not see this restriction as oppressive.

In 1994 Congress passed a ban on manufacturing “assault weapons” for civilian use. The aim was to stop the trade in easily concealed, modern, military-style lightweight weapons with high rates of fire and highly lethal ammunition.

The ban expired in 2004. Its renewal has repeatedly been blocked by gun rights advocates supported by the NRA.

Assault weapons with large magazines were used in the Newtown, Conn., and Aurora, Colo., shootings last year to kill 36 people (including 21 small children) and wound 60 more in a few short minutes.

Banning these weapons won’t limit the use of legitimate sporting arms.