The Senate on Thursday failed to override President Obama's veto of a resolution that would block a controversial clean water regulation handed down by the Environmental Protection Agency.

The EPA says the Waters of the U.S. rule would protect streams and wetlands that affect water quality and would more precisely define waters protected by the Clean Water Act. But ranchers, farmers and states argue it gives the federal agency unprecedented authority over drainage ditches and nearly anything else that can contain water.

Both the House and Senate passed a resolution to block the rule, but Obama vetoed the measure Tuesday night, and Majority Leader Mitch McConnell decided the next day to schedule a vote to override the veto.

The Senate first had to vote to end debate on the motion to hold the override vote, which needed 60 votes. But the Senate failed to get the necessary three-fifths vote to end debate, as the vote was 52-40, and the motion was killed. If the 60 votes were there, a two-thirds majority would have been needed to override Obama's veto.

Sen. John Barrasso, R-Wyo., said it should be up to the people who live on the land to make the best decision about how to use the land around the water in question.

"This is an incredible overreach on the part of this administration and on the part of this EPA," he said.

But Sen. Ben Cardin, D-Md., defended the rule by saying it comes from the Clean Water Act, passed by Congress, and simply seeks to clarify years of Supreme Court rulings that have complicated what waters are under federal control.

"It sets the parameters of what's going to be regulated and what's not, and it sets the prior application of Supreme Court cases as its guideline," Cardin said. "It's not paving new ground."

Obama said in his veto statement that the rule is critical to keeping the nation's water clean.

"We must protect the waters that are vital for the health of our communities and the success of our businesses, agriculture and energy development," Obama said Tuesday night. "As I have noted before, too many of our waters have been left vulnerable."

The resolution passed the Senate with a 53-44 vote in November, a sign that the resolution is a partisan measure and that the Senate had little chance of finding the two-thirds majority needed to override Obama's veto.

The rule is not currently in effect, as a federal court issued a stay in October while the U.S. Court of Appeals in Cincinnati decides if it has the power to make a ruling on whether the regulation is a legal use of federal power.

The rule was officially filed on Aug. 28 in the Federal Register, by which time 22 states had already filed a lawsuit to block it. A federal district court judge in North Dakota decided on Aug. 27 that it had the ability to block the rule in 13 states.

The lawsuit was brought by Alabama, Florida, Indiana, Kansas, Kentucky, Louisiana, Michigan, Mississippi, Ohio, Oklahoma, South Carolina, Tennessee, Texas, Utah, West Virginia and Wisconsin, along with the North Carolina Department of Environment and Natural Resources.