Image by Dennis Skley, CC BY-ND 2.0

The US Senate on Wednesday narrowly rejected a proposal that would have expanded the FBI's surveillance powers, including allowing searches of internet browsing histories without a court order.

The legislation, included as an amendment to a criminal-justice funding bill, would have expanded the types of communications records the FBI could have demanded by submitting national security letters, which don't require court approval. The proposal would have granted the FBI expanded access to telephone and internet records, including browser histories and email metadata.

The amendment, introduced earlier this week by Sen. John McCain (R-Arizona) to "track lone wolves" in the wake of the Orlando, Florida, massacre, fell two votes short of the required 60 votes to advance.

But the vote doesn't mean the measure is dead. Senate Majority Leader Mitch McConnell (R-Kentucky) switched his vote to "no" at the last minute, allowing him to bring it up for reconsideration as early as next week.