A total of 232 MPs late on Tuesday evening voted to defeat a no-confidence motion put forward against Justice Minister Zbigniew Ziobro by the opposition.
Meanwhile, 217 deputies supported the motion, and none abstained, state news agency PAP reported.
The bid had little chance of succeeding because the country’s governing conservatives hold a comfortable majority in parliament.
The vote came after the opposition earlier this month accused Ziobro, who also serves as prosecutor-general, of being "responsible for the disastrous condition of the Polish judiciary" and of using the prosecution service as a political weapon.
Conservative politicians including Prime Minister Mateusz Morawiecki defended Ziobro in parliament on Tuesday, saying the minister was spearheading "a fight against racketeers" and playing a key role in efforts to reform an inefficient judicial system marred by decades of neglect and irregularities.
Legal changes in Poland have triggered a series of clashes between Warsaw and Brussels in recent years.
Ziobro earlier this year slammed a move by the European Union's executive to open a new legal case against Poland over disciplinary rules for judges.