In order to become law the reform would need the signature of President Andrzej Duda and he is closely allied with the ruling conservative Law and Justice (PiS) party.
Once the bill is signed, the ruling Law and Justice Party, or PiS, will have the ability to force the resignation of all of Poland's top judges and appoint its own members to the Supreme Court.
People protest against the proposed judicial legislation in Warsaw on July 20.
Duda now has 21 days to sign the legislation into law.
The ruling populist Law and Justice party says the justice system is inefficient and needs radical reform. Poland is already embroiled in a row with the European Union over sweeping changes to the country's Constitutional Tribunal and concerns about the rule of law.
Tens of thousands of protesters gathered in Warsaw and cities across Poland for candle-lit vigils to protest against the draft bill, as the Senate debated it late into the night. Parliament has already passed bills this month giving politicians control over lower courts and the National Judicial Council.
Duda will meet Supreme Court President Malgorzata Gersdorf Monday, suggesting he won't make a decision before then.
"The rule of law is one of the values on which our union is founded and which defines our union", European Commission Vice President Frans Timmermans told reporters in Brussels.
Jewel Thief Doris Payne Charged With Walmart Theft
Police say that Doris has had over 22 aliases and has probably gotten away with more theft than anyone could really know. Payne exploits over the past six decades were examined in a 2013 documentary called The Life and Crimes of Doris Payne .
It is unlikely that the European Union would be able to remove Poland's voting rights over its judicial reforms, for instance, because Hungary would be able to veto such a motion and has indicated its willingness to do so. The opposition argues the measures amount to a "coup d'etat" but the PiS says the reforms are essential to rationalise the judicial system and fight corruption.
Once the legislation passes in the Senate, where PiS has a majority, the bill will go to President Duda, a PiS ally, for final approval. "We will not be intimidated by Polish and foreign defenders of the interests of the elite".
Critics at home and overseas say the legislation is part of a drift towards authoritarianism by the government, which espouses nationalist rhetoric coupled with left-leaning economic policy. Marek Pek, a Law and Justice senator, said the aim is to restore the proper balance of powers.
In Trump's troubling and unusual speech in Poland two weeks ago, the USA president said he was honored "to address the Polish nation that so many generations have dreamed of: a Poland that is safe, strong, and free". Only the country's president now stands in the way of what critics have called a move to authoritarianism.
"We are taking Poland in the right direction", Mazurek said.
The legislation sailed through the upper house of the parliament with no amendments, the Polish Press Agency (PAP) said.
Since being elected in 2015, PiS has sought to tighten government control over the courts, brought prosecutors and state media under direct government control. The poll was conducted on Tuesday and Wednesday, amid large street protests against the party's plan for the judiciary.